Function

GLibutf8_validate_len

since: 2.60

Declaration

gboolean
g_utf8_validate_len (
  const gchar* str,
  gsize max_len,
  const gchar** end
)

Description

Validates UTF-8 encoded text.

As with g_utf8_validate(), but max_len must be set, and hence this function will always return FALSE if any of the bytes of str are nul.

Available since: 2.60

Parameters

str

Type: An array of guint8

A pointer to character data.

The length of the array is specified in the max_len argument.
The data is owned by the caller of the function.
max_len

Type: gsize

Max bytes to validate.

end

Type: const gchar**

Return location for end of valid data.

The argument will be set by the function.
The argument can be NULL.
The data is owned by the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: gboolean

TRUE if the text was valid UTF-8