The mnemonic.dat file

The mnemonic.dat file contains POSIX mnemonic strings that can be used to replace unmappable source characters, if necessary, during character-set conversion.

mnemonic.dat contains only UCS-2 <-> mnemonic string conversions. Each Unicode mnemonic in the shipped mnemonic.dat file is a string of XPG4 characters representing a Unicode character. The mnemonic.dat file associates POSIX mnemonic strings with Unicode UCS-2 character encodings. Because the mnemonic strings use characters from the XPG4 Portable Character Set, the strings are suitable for use in any destination character set.

Location of mnemonic.dat

mnemonic.dat is located in the $SYBASE/config directory. See “Localization files” for a diagram of the $SYBASE/charsets directory structure.

How mnemonic.dat is used

mnemonic.dat is used only if the conversion configuration file (charset.cfg) for a destination character set specifies a mode of “Mnemonic.” If this is the case, then at conversion time mnemonic.dat is used as follows:

  1. If a source character is found to be unmappable in the destination character set, Sybase software converts the source character to Unicode UCS-2.

  2. Sybase looks up the UCS-2 encoding in mnemonic.dat and uses the mnemonic string associated with it in the destination data stream.

  3. If mnemonic.dat does not contain a suitable string, a Unicode UCS-2 hexadecimal string is used in the destination data stream.

See the Open Client and Open Server International Developer’s Guide for a detailed description on the character-set conversion process.

mnemonic.dat entries

mnemonic.dat contains entries that associate UCS-2 encodings with mnemonic strings.

Mnemonics section entries have the following form:

mnem = <mnem_string> 					<UCS-2_encoding> 					comment

where:

Mnemonics section entries look somewhat different from entries in other Sybase localization files. This is because Sybase uses standard POSIX definitions in mnemonic.dat.

mnemonic.dat example

The following is an example of a mnemonics file fragment:

[file format]
      version = 11.0
      escape = /
      list_separator = >
[copyright]
     copyright = "Copyright ... ."
[mnemonics]
      mnem = <NU> <U0000> NULL (NUL)
      mnem = <SH> <U0001> START OF HEADINGS(SOH)
      mnem = <SX> <U0002> START OF TEXT (STX)
      mnem = <EX> <U0003> END OF TEXT (ETX)
      mnem = <ET> <U0004> END OF TRANSMISSION (EOT)
      mnem = <EQ> <U0005> ENQUIRY (ENQ)
      mnem = <AK> <U0006> ACKNOWLEDGE (ACK)
      mnem = <BL> <U0007> BELL (BEL)
      mnem = <BS> <U0008> BACKSPACE (BS)
      .
      .
      .

Adding strings to mnemonic.dat

The mnemonic.dat file that Sybase ships does not contain strings for all characters in all character sets. Therefore, if mnemonic.dat does not contain a string that you need, you can insert the string using an operating system editor, such as vi.

The ftp site unicode.org has information on new Unicode mnemonic strings, as well as updates to existing strings.