Uri.unescapeSegment

string unescapeSegment(string escapedString = null, string escapedStringEnd = null, string illegalCharacters = null)

Unescapes a segment of an escaped string.

If any of the characters in illegal_characters or the NUL character 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.

Note

NUL byte is not accepted in the output, in contrast to

[glib.uri.Uri.unescapeBytes].

Parameters

escapedStringA string, may be null
escapedStringEndPointer to end of escaped_string, may be null
illegalCharactersAn optional string of illegal characters not to be allowed, may be null

Returns

an unescaped version of escaped_string,

or null on error. The returned string should be freed when no longer needed. As a special case if null is given for escaped_string, this function will return null.