HP-UX Reference (11i v2 04/09) - 4 File Formats (vol 8)
l
localedef(4) localedef(4)
An equivalence class is defined by a series of collating element entries all having the
same character or symbol in the first weight position. For example, in many locales all
forms of the character ’A’ collate equal on the first pass. This is represented in the collat-
ing element entries as:
’A’ ’A’;’A’ # first element of equivalence class
’a’ ’A’;’a’ # next element of class
Two-to-one collating elements are specified by collating-elements defined before the
order_start keyword. For example, the two-to-one collating element
CH in Spanish,
would be defined before the
order_start
keyword as
collating element <CH> from "CH"
It would then be used in a collating element entry as
<CH>.
A one-to-two collating element is defined by having a two-character string in one of the
weight positions. For example, if the character
’X’ collates equal to the pair "AE", the
collating element entry would be:
’X’ "AE";’X’
A don’t-care character is defined by the special symbol
IGNORE. For example, the dash
character,
’-’ may be a don’t care on the first collation pass. The collating element
entry is:
’-’ IGNORE;’-’
Symbols defined by the collating-symbol
keyword can be used to indicate that a
given character collates higher or lower than some position in the sequence. For example
if all characters with an encoded value less than that of
’0’ are to collate lower than all
other characters on the first pass, and in relative order on the second pass, define a col-
lating symbol before the order_start keyword:
collating-symbol <LOW>
The first two collating element entries are then:
... <LOW>;...
’0’ ’0’;’0’
This also illustrates the use of the ellipsis to indicate a range. The first ellipsis is inter-
preted as "all characters in the encoded character set with a value lower than ’0’"; the
second ellipsis means that all characters in the range defined by the first collate in rela-
tive order.
regular expression
regular expression operands conform to the Extended Regular Expressions
specifications as described in regexp(5).
Metacharacters
Metacharacters are characters having a special meaning to localedef in operands. To escape the special
meaning of these characters, surround them with single quotes or precede them by an escape character.
localedef meta-characters include:
< Indicates the beginning of a symbolic name.
> Indicates the end of a symbolic name.
( Indicates the beginning of a character shift pair following the toupper and tolower
keywords.
) Indicates the end of a character shift pair.
, Used to separate the characters of a character shift pair.
" Used to quote strings.
; Used as a separator in list operands.
escape character
Used to escape special meaning from other metacharacters and itself. It is backslash (\) by
default, but can be redefined by the
escape_char keyword.
HP-UX 11i Version 2: September 2004 − 8 − Hewlett-Packard Company Section 4−−169