### LC_COLLATE Locale Category

The LC_COLLATE category definition in a locale source file establishes the relative order between collating elements in the locale that is compiled from that source by the LOCALDEF utility.

Collating elements are single characters or sequences of characters specified with the collating element LC_COLLATE keyword. Collating rules consist of ordered sets of collating order statements. The LC_COLLATE keywords establish a collation sequence that assigns each element one or more collation values, or collation weights.

The LC_COLLATE category supports the following capabilities:

- Multicharacter collating elements. Specification of multicharacter collating elements (sequences of two or more characters to be collated as an entity).
- User-defined ordering of collating elements. Each collating element is assigned a collation value defining its order in the character (or basic) collation sequence. This ordering is used by regular expressions and pattern matching, and unless collation weights are explicitly specified, also as the collation weight to be used in sorting.
- Multiple weights and equivalence classes. Collating elements can be assigned 1 to 6 collating weights for use in sorting. The first weight is referred to as the primary weight.
- One-to-many mapping. A single character is mapped into a string of collating elements.
- Many-to-Many substitution. A string of one or more characters are mapped to another string (or an empty string). The character or characters are ignored for collation purposes.
- Equivalence class definition. Two or more collating elements have the same collation value (primary weight).
- Ordering by weights. When two strings are compared to determine their relative order, the two strings are first broken up into a series of collating elements. Each successive pair of elements is compared according to the relative primary weights for the elements. If they are equal, and more than one weight is assigned, then the pairs of collating elements are compared again according to the relative subsequent weights, until either two collating elements are not equal or the weights are exhausted.

Example: LC_COLLATE Locale Category Definition

Internationalization
Localization and Locales

Customize a Locale

LC_COLLATE Collating Rules
LC_COLLATE Collating Keywords
Locale Categories
Locale Source Files