Function

GLibutf8_collate_key

Declaration [src]

gchar*
g_utf8_collate_key (
  const gchar* str,
  gssize len
)

Description [src]

Converts a string into a collation key that can be compared with other collation keys produced by the same function using strcmp().

The results of comparing the collation keys of two strings with strcmp() will always be the same as comparing the two original keys with g_utf8_collate().

Note that this function depends on the [current locale][setlocale].

Parameters

str const gchar*
 

A UTF-8 encoded string.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
len gssize
 

Length of str, in bytes, or -1 if str is nul-terminated.

Return value

Returns: gchar*
 

A newly allocated string. This string should be freed with g_free() when you are done with it.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The string is a NUL terminated UTF-8 string.