indigo. icu.ucol

Created12.05.2005
Last modified12.05.2005

C API for locale-sensitive string comparison.

See the official documentation at http://icu.sourceforge.net- /apiref- /icu4c- /ucol_8h.html.

Summary
Collator for use in C programs.
Possible values for a comparison result.
Enum containing attribute values for controling collation behavior.
Attributes that collation service understands.
Options for retrieving the rule string.
Open a UCollator for comparing strings, for the specified locale.
Close the collator coll.
Compares the strings s1 and s2 with the collator coll.
This is the collator for the standard locale retrieved from the operating system.

UCollator

Collator for use in C programs.

Summary
Possible values for a comparison result.
Enum containing attribute values for controling collation behavior.
Attributes that collation service understands.
Options for retrieving the rule string.
Open a UCollator for comparing strings, for the specified locale.
Close the collator coll.
Compares the strings s1 and s2 with the collator coll.
This is the collator for the standard locale retrieved from the operating system.

Enumerations

UCollationResult

Possible values for a comparison result.  See ucol_strcoll().

UColAttributValue

Enum containing attribute values for controling collation behavior.  Here are all the allowable values.  Not every attribute can take every value.  The only universal value is UCOL_DEFAULT, which resets the attribute value to the predefined value for that locale.

UColAttribute

Attributes that collation service understands.  All the attributes can take UCOL_DEFAULT value, as well as the values specific to each one.

UColRuleOption

Options for retrieving the rule string.

Functions

ucol_open()

UCollator* function(char *locale,
UErrorCode *status) ucol_open

Open a UCollator for comparing strings, for the specified locale. status will signalize if that failed.  Passing null for the locale sets the default locale to be used, passing an empty string set the UCA rules to be used.

The UCollator pointer is used in all the calls to the Collation service.  After finished, collator must be disposed of by calling ucol_close().

ucol_close()

void function(UCollator *coll) ucol_close

Close the collator coll.  Once closed, a UCollator should not be used.  Every open collator should be closed when not used any more, otherwise a memory leak will result.

ucol_strcoll()

UCollationResult function(UCollator *coll,
UChar *s1,
int32_t s1Len,
UChar *s2,
int32_t s2Len) ucol_strcoll

Compares the strings s1 and s2 with the collator coll.

See also UCollationResult.

Variables

ucol_stdColl

UCollator* ucol_stdColl

This is the collator for the standard locale retrieved from the operating system.  It is automatically opened at program startup and closed at program closure.  See <indigo.icu.uloc.uloc_getStandard()> and ucol_open().

UCollator* function(char *locale,
UErrorCode *status) ucol_open
Open a UCollator for comparing strings, for the specified locale.
void function(UCollator *coll) ucol_close
Close the collator coll.
UCollationResult function(UCollator *coll,
UChar *s1,
int32_t s1Len,
UChar *s2,
int32_t s2Len) ucol_strcoll
Compares the strings s1 and s2 with the collator coll.
UCollator* ucol_stdColl
This is the collator for the standard locale retrieved from the operating system.
Possible values for a comparison result.