The conversion configuration file for a character set specifies how conversions to other character sets should take place. Among other things, it indicates whether a conversion is table- or algorithm-driven.
For more information about the conversion process, see Chapter 4, “Coded Character Set Conversion Support.”
Conversion configuration files contain:
Standard sections
A conversion section
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 following 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.
The table keyword indicates that the conversion is table-driven.
mode is the conversion mode to use. It applies to table-driven conversions only. The following table lists the legal values for mode:
Value |
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 that is defined in the 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 that is defined in the 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 that is defined in the conversion configuration file. |
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.
The sys_algorithm keyword indicates that the conversion uses a standard Open Client/Server conversion algorithm.
multiplier is an integer value representing the conversion multiplier for the conversion. This value indicates the maximum amount that string length can increase during conversion.
The following example shows 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