Conversion configuration files

The conversion configuration file for a character set contains information on how the conversion process should proceed.

How conversion configuration files are used

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.

Table C-2: Coded character set 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.

Location of the conversion configuration files

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.

Conversion configuration file entries

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:

Algorithm-driven entries have the following form:

[conversion]
convertto = dest_charset, sys_algorithm, multiplier

where:

Conversion configuration file example

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