URI.normalize

%<!-- -->-decodes any "unreserved" characters (or characters in @unescape_extra) in @part, and %<!-- -->-encodes any non-ASCII characters, spaces, and non-printing characters in @part.

"Unreserved" characters are those that are not allowed to be used for punctuation according to the URI spec. For example, letters are unreserved, so soup_uri_normalize() will turn <literal>http://example.com/foo/b%<!-- -->61r</literal> into <literal>http://example.com/foo/bar</literal>, which is guaranteed to mean the same thing. However, "/" is "reserved", so <literal>http://example.com/foo%<!-- -->2Fbar</literal> would not be changed, because it might mean something different to the server.

In the past, this would return %NULL if @part contained invalid percent-encoding, but now it just ignores the problem (as soup_uri_new() already did).

class URI
static
string
normalize
(
string part
,)

Parameters

part string

a URI part

unescapeExtra string

reserved characters to unescape (or %NULL)

Return Value

Type: string

the normalized URI part

Meta