utf8Strreverse

Reverses a UTF-8 string. str must be valid UTF-8 encoded text. (Use glib.global.utf8Validate 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 glib.global.strreverse, this function returns newly-allocated memory, which should be freed with glib.global.gfree when no longer needed.

string
utf8Strreverse
(
string str
,
ptrdiff_t len
)

Parameters

str string

a UTF-8 encoded string

len ptrdiff_t

the maximum length of str to use, in bytes. If len < 0, then the string is nul-terminated.

Return Value

Type: string

a newly-allocated string which is the reverse of str