Function

GLibutf8_casefold

Declaration

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

Description

Converts a string into a form that is independent of case. The result will not correspond to any particular case, but can be compared for equality or ordered with the results of calling g_utf8_casefold() on other strings.

Note that calling g_utf8_casefold() followed by g_utf8_collate() is only an approximation to the correct linguistic case insensitive ordering, though it is a fairly good one. Getting this exactly right would require a more sophisticated collation function that takes case sensitivity into account. GLib does not currently provide such a function.

Parameters

str

Type: const gchar*

A UTF-8 encoded string.

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

Type: gssize

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

Return value

Type: gchar*

A newly allocated string, that is a case independent form of str.

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