The following functions implement comparison that ignores differences in case and normalization.
Returns the case folded string.
Comparing
u8_casefold (s1)andu8_casefold (s2)with theu8_cmp2function is equivalent to comparing s1 and s2 withu8_casecmp.The nf argument identifies the normalization form to apply after the case-mapping. It can also be NULL, for no normalization.
Returns the case folded string. The case folding takes into account the case mapping contexts of the prefix and suffix strings.
Compares s1 and s2, ignoring differences in case and normalization.
The nf argument identifies the normalization form to apply after the case-mapping. It can also be NULL, for no normalization.
If successful, sets
*resultp to -1 if s1 < s2, 0 if s1 = s2, 1 if s1 > s2, and returns 0. Upon failure, returns -1 witherrnoset.
The following functions additionally take into account the sorting rules of the current locale.
Converts the string s of length n to a NUL-terminated byte sequence, in such a way that comparing
u8_casexfrm (s1)andu8_casexfrm (s2)with the gnulib functionmemcmp2is equivalent to comparing s1 and s2 withu8_casecoll.nf must be either
UNINORM_NFC,UNINORM_NFKC, or NULL for no normalization.
Compares s1 and s2, ignoring differences in case and normalization, using the collation rules of the current locale.
The nf argument identifies the normalization form to apply after the case-mapping. It must be either
UNINORM_NFCorUNINORM_NFKC. It can also be NULL, for no normalization.If successful, sets
*resultp to -1 if s1 < s2, 0 if s1 = s2, 1 if s1 > s2, and returns 0. Upon failure, returns -1 witherrnoset.