In locale source files, you should use symbolic names for individual characters, characters in strings, and collating elements. Characters can also be represented as the characters themselves, or as octal, hexadecimal, or decimal constants. If you use non-symbolic notation, the resultant locale definition file may not be portable among systems and environments. The left angle bracket (<) is a reserved symbol, denoting the start of a symbolic name. If you use it to represent itself, you must precede it with the escape character. The default escape character is the backslash (\), as specified by <escape_char> in the charmap file.
Locale source files recognize the following representations for a character:
Symbolic name
A character can be represented by a symbolic name, enclosed
within angle brackets. The symbolic name, including the angle
brackets, must exactly match a symbolic name defined in the charmap file. The symbolic name is replaced by the character
value determined from the value associated with the symbolic name
in the charmap file.
The use of a symbolic name not found in the charmap file constitutes an error, unless the name is in the category LC_CTYPE or LC_COLLATE, in which case it constitutes a warning. Use of the escape character or right angle bracket within a symbolic name is invalid unless the character is preceded by the escape character. For example:
| <c>;<c-cedilla> | specifies two characters whose symbolic names are "c" and "c-cedilla" |
| "<M><a><y>" | specifies a 3-character string composed of letters represented by symbolic names "M", "a", and "y" |
| "<a><\>>" | specifies a 2-character string composed of letters represented by symbolic names "a" and ">" (assuming the escape character is \) |
Character
representing itself
Within a string, the double quotation mark, the escape character,
and the left angle bracket must be escaped (preceded by the
escape character) to be interpreted as the characters themselves.
For example:
| c | 'c' character represented by itself |
| "may" | represents a 3-character string, each character within the string represented by itself |
| "###"#>" | represents the three character long string "#">", where the escape character is defined as # |
Octal Constant
A character can be represented as an octal constant. An octal
constant is specified as the escape character followed by two or
more octal digits. Each constant represents a byte value. For
example:
\131 "\212\126\165" \16\66\163\17
Hexadecimal Constant
A character can be represented as a hexadecimal constant. A
hexadecimal constant is specified as the escape character,
followed by an x, followed by two or more
hexadecimal digits. Each constant represents a byte value. For
example:
\x83 "\xD4\x81\xA8"
Decimal Constant
A character can be represented as a decimal constant. A decimal
constant is specified as the escape character followed by two or
more decimal digits. Each constant represents a byte value. For
example:
\d131 "\d212\d129\d168" \d14\d66\d193\d15
Multibyte Character
Multibyte characters can be represented by concatenating
constants specified in byte order with the last constant
specifying the least significant byte of the character.
![]()
Locale Categories
Locale Source Files