On 07-Nov-2011 08:31 , Loek Maartens wrote:

Is it possible to define my own CCSID translation table?

In the past I did use the code pages with the QDCXLATE api, but
now I am faced with UTF-8 ccsid and need to do a translation from
accented characters (french, german, etc) to simple characters.

Since I can not find a matching CCSID I am looking on building my
own, but fail to find any references, except some references in
CICS.


I believe the desired outcome is possible with existing CCSID character string conversion; i.e. without creating your own CCSID. Look at using the iconv() API using "Linguistic conversion. Also known as best-fit conversion" such that "Characters that are not in the target CCSID are mapped to the most culturally acceptable alternative for that character."
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/apis/nls3.htm
"For example, the source CCSID might support an A grave character (Å). The target CCSID might not support this character. During the conversion, the most linguistically acceptable character (a Latin capital A) is substituted for the A grave. After the conversion, characters that are not included in the target CCSID are presented to the user as the most linguistically acceptable substitution characters. This substitution is permanent. Any loss of character integrity is permanent.

Through an application programming interface (API), linguistic conversion is available from any supported single-byte CCSID to any other supported single-byte CCSID."

The "Code Conversion Allocation (iconv_open()) performs the necessary initializations to convert character encodings and returns a conversion descriptor of type iconv_t" and includes the capability on the "fromcode" string [aka API Format] to specify a 3-byte "Conversion alternative" value.
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/apis/iconvopn.htm
"Conversion alternative. The conversion alternative that is selected to convert graphic character data. This value is only used on the fromcode parameter. The following values can be used:
000 The IBM®-defined default conversion method and the associated conversion tables. Most of the default tables follow the round-trip conversion criterion. For the default tables that do not follow the round-trip conversion criterion, see the i5/OS® globalization topic collection.
057 The enforced subset match (substitution) criterion. For the CCSID conversion pairs that support this criterion, see i5/OS globalization.
102 The best-fit conversion criterion for character mismatch."

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.