Uri.unescapeBytes

Unescapes a segment of an escaped string as binary data.

Note that in contrast to glib.uri.Uri.unescapeString, this does allow nul bytes to appear in the output.

If any of the characters in illegal_characters appears as an escaped character in escaped_string, then that is an error and null will be returned. This is useful if you want to avoid for instance having a slash being expanded in an escaped path element, which might confuse pathname handling.

class Uri
static
unescapeBytes
(,
ptrdiff_t length
,
string illegalCharacters = null
)

Parameters

escapedString string

A URI-escaped string

length ptrdiff_t

the length (in bytes) of escaped_string to escape, or -1 if it is nul-terminated.

illegalCharacters string

a string of illegal characters not to be allowed, or null.

Return Value

Type: glib.bytes.Bytes

an unescaped version of escaped_string or null on error (if decoding failed, using G_URI_ERROR_FAILED error code). The returned #GBytes should be unreffed when no longer needed.