
URLDECODE function
URLDECODE is a string manipulation function that manipulates CHARACTER string data.
Syntax
URLDECODE returns a CHARACTER string that contains the decoded form of the source string that was previously encoded by using either RCF3986 or RCF 1738 as specified in the URLENCODE function.
The URLDECODE function copies the source string and replaces any 3-character sequences that start
with a %
(percent) character followed by 2 hexadecimal digits with the UTF-8
character represented by those hexadecimal digits.
The source string is a string of the CHARACTER data type. The source string is converted to the UTF-8 code page before it is decoded. If SourceExpression is NULL, the result is NULL.
An example that shows encoding using RCF3986 in the URLENCODE function, and then subsequent decoding by using the URLDECODE function:
DECLARE original CHARACTER 'Address=Hampshire,United Kingdom';
DECLARE encoded CHARACTER URLENCODE(original);
results in the following encoded string:
Address%3DHampshire%2CUnited%20Kingdom
Use the URLDECODE function to decode the encoded string:
DECLARE decoded CHARACTER URLDECODE(encoded);
results in the following decoded string:
Address=Hampshire,United Kingdom
