Library url

To use this library in your code:

import encoding.url

Classes

A QueryString is a part of a uniform resource locator (URL) that assigns values to specified parameters. It fits between the resource parts and the fragment part in the URL encoding:

Functions

Decodes the given data using URL-encoding, also known as percent encoding.
The function is liberal, accepting unencoded characters that should be encoded, with the exception of '%'.
Plus signs (+) are not decoded to spaces.
Example

  url.decode "foo%20b%C3%A5r"  // Returns "foo bår".

Variant of decode.
Decodes the given data using URL-encoding and returns the result as a byte array.
The encoded data may contain characters that are not valid UTF-8.

Encodes the given data using URL-encoding, also known as percent encoding.
The characters 0-9, A-Z, and a-z are unchanged by the encoding, as are the characters '-', '_', '.', and '~'. All other characters are encoded in hexadecimal, using the percent sign. Thus a space character is encoded as "%20", and the Unicode snowman (☃) is encoded as "%E2%98%83".