Defines character symbols as character encodings.
The character set description (charmap) source file defines character symbols as character encodings. The /usr/lib/nls/charmap directory contains charmap source files for supported locales. The localedef command recognizes two sections in charmap source files, the CHARMAP section and the CHARSETID section:
CHARMAP | Maps symbolic character names to code points. This section must precede all other sections, and is mandatory. |
CHARSETID | Maps the code points within the code set to a character set ID. This sections is optional. |
The CHARMAP section of the charmap file maps symbolic character names to code points. All supported code sets have the portable character set as a proper subset. Only symbols that are not defined in the portable character set must be defined in the CHARMAP section. The portable character set consists of the following character symbols (listed by their standardized symbolic names) and encodings:
The CHARMAP section contains the following sections:
Each statement in this section defines a symbolic name for a character encoding. A character symbol begins with the < (less-than) character and ends with the > (greater-than) character. The characters between the < (less-than) and > (greater-than) can be any characters from the portable character set, except for control and space characters. The > (greater-than) character may be used if it is escaped with the escape character (as specified by the <escape_char> special symbolic name). A character symbol cannot exceed 32 characters in length.
The format of a character symbol definition is:
<char_symbol> encoding optional commentAn encoding is specified as one or more character constants, with the maximum number of character constants specified by the <mb_cur_max> special symbolic name. The localedef command supports decimal, octal, and hexadecimal constants with the following formats:
hexadecimal constant \xddd octal constant \oddd decimal constant \ddddSome examples of character symbol definitions are:
<A> \d65 decimal constant <B> \x42 hexadecimal constant <j10101> \x81\d254 mixed hex and decimal constantsA range of one or more symbolic names and corresponding encoding values may also be defined, where the nonnumeric prefix for each symbolic name is common, and the numeric portion of the second symbolic name is equal to or greater than the numeric portion of the first symbolic name. In this format, a symbolic name value consists of zero or more nonnumeric characters followed by an integer of one or more decimal digits. This format defines a series of symbolic names. For example, the string <j0101>...<j0104> is interpreted as the <j0101>, <j0102>, <j0103>, and <j0104> symbolic names, in that order.
In statements defining ranges of symbolic names, the encoded value is the value for the first symbolic name in the range. Subsequent symbolic names have encoding values in increasing order. For example:
<j0101>...<j0104> \d129\d254This character set mapping statement is interpreted as follows:
<j0101> \d129\d254 <j0102> \d129\d255 <j0103> \d130\d0 <j0104> \d130\d1Symbolic names must be unique, but two or more symbolic names can have the same value.
The following is an example of a portion of a possible CHARMAP section from a charmap file:
CHARMAP <code_set_name> ISO8859-1 <mb_cur_max> 1 <mb_cur_min> 1 <escape_char> \ <comment_char> # <NUL> \x00 <SOH> \x01 <STX> \x02 <ETX> \x03 <EOT> \x04 <ENQ> \x05 <ACK> \x06 <alert> \x07 <backspace \x09 <tab> \x09 <newline> \x0a <vertical-tab> \x0b <form-feed> \x0c <carriage-return> \x0d END CHARMAP
The CHARSETID section maps the code points within the code set to a character set ID. The CHARSETID section contains the following sections:
Character set ID mappings are defined by listing symbolic names or code points for symbolic names and their associated character set IDs. The following are possible formats for a character set ID mapping statement:
<character_symbol> number <character_symbol>...<character_symbol> number character_constant number character_constant...character_constant number
The <character_symbol> used must have previously been defined in the CHARMAP section. The character_constant must follow the format described for the CHARMAP section.
Individual character set mappings are accomplished by indicating either the symbolic name (defined in the CHARMAP section or the portable character set) followed by the character set ID, or the code point associated with a symbolic name followed by the character set ID value. Symbolic names and code points must be separated from a character set ID value by one or more blank characters. Ranges of code points can be mapped to a character set ID value by indicating appropriate combinations of symbolic names and code point values as endpoints to the range, separated by ... (ellipsis) to indicate the intermediate characters, and followed by the character set ID for the range. The first endpoint value must be less than or equal to the second end point value.
The following is an example of a portion of a possible CHARSETID section from a charmap file:
CHARSETID <space>...<nobreakspace> 0 <tilde>...<y-diaeresis> 1 END CHARSETID
This file format is part of the Base Operating System (BOS) Runtime.
Locale Definition Source File Format, Locale Method Source File Format.
For specific information about the locale categories and keywords, see the LC_COLLATE category, LC_CTYPE category, LC_MESSAGES category, LC_MONETARY category, LC_NUMERIC category, and LC_TIME category.
The locale command, localedef command.
For information on converting data between code sets, see Converters Overview for System Management, National Language Support Overview for System Management, Understanding the Character Set Description (charmap) Source File in AIX Version 4.3 System Management Guide: Operating System and Devices.