Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
File Format Reference Pages locale(4)
be defined in the provided character set description source file (charmap).
A character literal is the character itself, or else a decimal, hexadecimal, or octal constant. A
decimal constant is of the following form:
\dddd
where d is a decimal digit. A hexadecimal constant is of the following form:
\xxxx
where x is a hexadecimal digit. An octal constant is of the following form:
\ooo
where o is an octal digit.
The explicit definition of each category in a locale definition source file is not required. When a
category is undefined in a locale definition source file, it defaults to the C locale definition.
The LC_COLLATE Category
The LC_COLLATE category defines the relative order between collating elements.
A collation element is the unit of comparison for collation. A collation element may be a charac-
ter or a sequence of characters. Every collation element in the locale has a set of weights, which
determine if the collation element collates before, equal to, or after the other collation elements
in the locale. Each collation element is assigned collation weights by the localedef command
when the locale definition source file is compiled. These collation weights are then used by
applications programs that compare strings.
Comparison of strings is performed by comparing the collation weights of each character in the
string until either a difference is found or the strings are determined to be equal. This com-
parison may be performed several times if the locale defines multiple collation orders. For exam-
ple, in the French locale, the strings are compared using a primary set of collation weights. If
they are equal on the basis of this comparison, they are compared again using a secondary set of
collation weights. A collating element has a set of collation weights associated with it that is
equal to the number of collation orders defined for the locale.
Every character defined in the charmap file (or every character in the portable character set if no
charmap file is specified) is itself a collating element. Additional collating elements can be
defined using the collating-element statement. The syntax is as follows:
collating-element <character_symbol> from <string>
The LC_COLLATE category begins with the keyword LC_COLLATE and ends with the END
LC_COLLATE keyword.
The following keywords are recognized in the LC_COLLATE category:
collating-element
The collating-element statement is used to specify multicharacter collating elements.
The character_symbol argument defines a collating element that is a string of one or
more characters as a single collating element. The character_symbol argument cannot
duplicate any symbolic name in the current charmap file, or any other symbolic name
defined in this collation definition. The string argument specifies a string of two or
more characters that define the character_symbol argument. The following are exam-
ples of the syntax for the collating-element statement:
collating-element <ch> from <c><h>
collating-element <e-acute> from <acute><e>
collating-element <11> from <1><1>
527188-021 Hewlett-Packard Company 11−11