Function

GLibutf8_collate

Declaration [src]

gint
g_utf8_collate (
  const gchar* str1,
  const gchar* str2
)

Description [src]

Compares two strings for ordering using the linguistically correct rules for the [current locale][setlocale]. When sorting a large number of strings, it will be significantly faster to obtain collation keys with g_utf8_collate_key() and compare the keys with strcmp() when sorting instead of sorting the original strings.

Parameters

str1 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.
str2 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.

Return value

Returns: gint
 

< 0 if str1 compares before str2, 0 if they compare equal, > 0 if str1 compares after str2.