urlDecode()

The function decodes a percent-encoded URL into a regular string.

Synopsis

string urlDecode(string encoded);

Parameters

Parameter Description
encoded An encoded URL to decode.

Return value

The function returns the decoded URL.

Description

In some cases when using webservices (e.g. posting a Tweet on Twitter), you need to percent-encode a URL. This is required when calling the netPost() function with "Content-Type", "application/x-www-form-urlencoded".

Therefore, you need the functions: urlDecode() and urlEncode(). The function urlEncode() encodes the decoded parameter into URL encoding format and urlDecode() decodes it back to a string.

For more information on URL encoding, see https://en.wikipedia.org/wiki/URL_encoding.

Availability

UI, CTRL