The conversion configuration file for a character set contains information on how the conversion process should proceed.
When clients and servers use different character sets, conversion between the character sets is necessary. Open Client and Open Server products include files to support conversions for each character set.
The conversion configuration file for a character set specifies what mode to use for the conversion and what replacement character to use for unmappable characters.
Table C-2 describes conversion modes.
Mode |
Description |
---|---|
MATCH Shipped files contain this value. |
The conversion process converts matching source and destination values. If the code for a source character is illegal or unmappable, the conversion process uses the destination replacement character defined in the destination character set’s conversion configuration file. |
BESTGUESS |
The conversion process converts matching and best-guess source and destination values. If the code for a source character is illegal or unmappable, the conversion process uses the destination replacement character defined in the destination character set’s conversion configuration file. |
MNEMONIC |
Converts matching source and destination values. If there is no match for a source value, the conversion process uses a Unicode mnemonic string as the destination value. If there is no suitable mnemonic string, the conversion process uses a Unicode hexadecimal string as the destination value. If the code for a source character is illegal, the conversion process uses the destination replacement character defined in the destination character set’s conversion configuration file. |
The Open Client and Open Server International Developer’s Guide contains a detailed description of the character set conversion process.
Each character set has a conversion configuration file, located at $SYBASE/charsets/charset_name/charset_name.cfg.
See “Localization files” for a diagram of the $SYBASE/charsets directory structure.
The conversion section contains entries that describe how conversion to a particular character set should take place. Conversion section entries can indicate either table-driven or algorithm-driven conversion.
Table-driven entries have the form:
[conversion]
convertto = dest_charset, table, mode, replacement_char
where:
dest_charset is the name of the destination character set.
, (comma) is the list separator character for the file.
table is a keyword that indicates that the conversion is table-driven.
mode is the conversion mode to use. It applies to table-driver conversions only. The valid values are:
MATCH
BESTGUESS
MNEMONIC
See Table C-2 for a complete description of each mode.
replacement_char is a hexadecimal (without 0x prefix) encoding of the destination replacement character to use during MATCH and BESTGUESS mode conversions.
Algorithm-driven entries have the following form:
[conversion]
convertto = dest_charset, sys_algorithm, multiplier
where:
dest_charset is the name of the destination character set.
, (comma) is the list separator character for the file.
sys_algorithm is a keyword that indicates that the conversion uses a standard Open Client and Open Server conversion algorithm.
multiplier is an integer value representing the conversion multiplier for the conversion. This value indicates the maximum amount that strings may increase in length during conversion.
Following is an example of a conversion configuration file:
; Conversion Configuration File for iso_1 charset.
[conversion]
convertto = utf8, table, MATCH, 3F
convertto = cp850, sys-algorithm, 1
convertto = cp437, sys-algorithm, 1
convertto = roman8, sys-algorithm, 1
convertto = mac, sys-algorithm, 1