Function
GLibutf8_strreverse
since: 2.2
Declaration [src]
gchar*
g_utf8_strreverse(
constgchar*str,
gssizelen
)
Description [src]
Reverses a UTF-8 string.
str must be valid UTF-8 encoded text. (Use g_utf8_validate() on all
text before trying to use UTF-8 utility functions with it.)
This function is intended for programmatic uses of reversed strings. It pays no attention to decomposed characters, combining marks, byte order marks, directional indicators (LRM, LRO, etc) and similar characters which might need special handling when reversing a string for display purposes.
Note that unlike g_strreverse(), this function returns
newly-allocated memory, which should be freed with g_free() when
no longer needed.
Available since: 2.2
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:
gssizeThe maximum length of
strto use, in bytes. Iflenis negative, then the string is nul-terminated.
Return value
Type: gchar*
A newly-allocated string which is the reverse of str.