icuSetCollate(...)
icuSetCollate
can be used to tune the way collation is done.
On other builds calling this function does nothing, with a warning.Possible arguments are
locale
:"da_DK"
giving the
country whose collation rules are to be used. If present, this
should be the first argument.
case_first
:"upper"
, "lower"
or
"default"
, asking for upper- or lower-case characters to be
sorted first. The default is usually lower-case first, but not in
all languages (see the Danish example).
alternate_handling
:"non_ignorable"
(primary strength) and
"shifted"
(quaternary strength).
strength
:"primary"
, "secondary"
, "tertiary"
(default), "quaternary"
and "identical"
.
french_collation
:"on"
, "off"
and "default"
.
normalization
:"on"
and "off"
(default). This affects the
collation of composite characters.
case_level
:"on"
and "off"
(default).
hiragana_quaternary
:"on"
(sort
Hiragana first at quaternary level) and "off"
.
Only the first three are likely to be of interest except to those with a detailed understanding of collation and specialized requirements.
Some examples are case_level = "on", strength = "primary"
to ignore
accent differences and alternate_handling = "shifted"
to ignore
space and punctuation characters.
Note that these settings have no effect if collation is set to the
C
locale, unless locale
is specified.
sort
The ICU user guide chapter on collation (http://userguide.icu-project.org/collation).