Function

Birbutf8_compare

since: 0.9

Declaration [src]

int
birb_utf8_compare (
  const char* str1,
  const char* str2
)

Description [src]

Compares two UTF8 strings for sorting.

The strings will be normalized with NFKC using g_utf8_normalize(), then have their cases folded with g_utf8_casefold(), and finally compared with g_utf8_collate().

The strings need not be valid UTF8. If one is UTF8 and the other is not, then the UTF8 string will be given precedence. If comparing %null and an invalid UTF8 string, the invalid UTF8 string will be given precedence. If neither are valid UTF8 they will be considered equal regardless of contents.

Available since: 0.9

Parameters

str1

Type: const char*

The first string.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
str2

Type: const char*

The second string.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: int

-1, 0, 1 if str1 is less than, equal to, or greater than str2.