Unicode.utf8_Validate

Validates UTF-8 encoded text. str is the text to validate; if str is nul-terminated, then max_len can be -1, otherwise max_len should be the number of bytes to validate. If end is non-NULL, then the end of the valid range will be stored there (i.e. the start of the first invalid character if some bytes were invalid, or the end of the text being validated otherwise). Note that g_utf8_validate() returns FALSE if max_len is positive and any of the max_len bytes are NUL. Returns TRUE if all of str was valid. Many GLib and GTK+ routines require valid UTF-8 as input; so data read from a file or the network should be checked with g_utf8_validate() before doing anything else with it.

class Unicode
static
int
utf8_Validate
(
string str
,
out string end
)

Parameters

str string

a pointer to character data. [array length=max_len][element-type guint8]

end string

return location for end of valid data. [allow-none]out[transfer none]

Return Value

Type: int

TRUE if the text was valid UTF-8

Meta