Next: Duplicating a NUL terminated Unicode string, Previous: Copying a NUL terminated Unicode string, Up: Elementary string functions on NUL terminated strings [Contents][Index]
The following functions compare two Unicode strings. They ignore locale-dependent collation rules.
Compares s1 and s2, lexicographically. Returns a negative value if s1 compares smaller than s2, a positive value if s1 compares larger than s2, or 0 if they compare equal.
This function is similar to strcmp
and wcscmp
, except
that it operates on Unicode strings.
Compares s1 and s2 using the collation rules of the current
locale.
Returns -1 if s1 < s2, 0 if s1 = s2, 1 if
s1 > s2. Upon failure, sets errno
and returns any value.
This function is similar to strcoll
and wcscoll
, except
that it operates on Unicode strings.
Note that this function may consider different canonical normalizations
of the same string as having a large distance. It is therefore better to
use the function u8_normcoll
instead of this one; see Normalization forms (composition and decomposition) <uninorm.h>
.
Compares no more than n units of s1 and s2.
This function is similar to strncmp
and wcsncmp
, except
that it operates on Unicode strings.