URL_DECODE
The function URL_DECODE takes a String and returns a new string by unescaping any URL Percent Encoded characters.
This function takes a String and parses any Percent Encoded characters in the string.
Declaration
Parameters
url (type: string)
The URL to decode.
Return Values
decoded_url (type: string)
The decoded URL
Examples
A google search URL contains the search query in a URL parameter. For example, to search for the string "date/time", the URL is "https://www.google.com/search?q=date%2Ftime". Note that the slash is replaced by the percent-encoding "%2F". The URL_DECODE function can be used to convert such characters back into the original character that they represent.
Discussion
The function URL_ENCODE performs the opposite operation. It will replace any characters that have a special meaning in a URL and replace those characters with the appropriate percent-encoding. Encoding a string, and then decoding the result will return the original string.
Note, however, that the URL_ENCODE function can also take numbers and booleans, in this case encoding and then decoding the value will not produce the original value, but rather a string representing the original value.
Last updated