GLib.Uri.unescape_segment
Description: Reference for GLib.Uri.unescape_segment

### Function

# GLib Uriunescape_segment

since: 2.16

#### Declaration [src]

    char*
    g_uri_unescape_segment (
      const char* escaped_string,
      const char* escaped_string_end,
      const char* illegal_characters
    )

#### Description [src]

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 g_uri_unescape_bytes().

Available since: 2.16

#### Parameters

`escaped_string`

  Type: `const char*`

  A string, may be `NULL`.

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

`escaped_string_end`

  Type: `const char*`

  Pointer to end of `escaped_string`, may be `NULL`.

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

`illegal_characters`

  Type: `const char*`

  An optional string of illegal characters not to be allowed, may be `NULL`.

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

#### Return value

Type: `char*`

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`.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The return value can be `NULL`.
The value is a NUL terminated UTF-8 string.