Decodes an encoded URL (which means with characters in %xx format).
Remark: The syntax of the URL is not checked.
// Decodes a URL
DecodedURL is string = URLDecode("http://mysite/my%20report")
// DecodedURL contains: http://mysite/my report
Syntax
<Result> = URLDecode(<URL to decode> [, <Encoding/decoding format>])
<Result>: Character string
Character string containing the decoded URL. The following characters are converted:- '+' is converted to spaces
- '%xx' (where xx is a hexadecimal value) is replaced by the character whose hexadecimal value is xx.
<URL to decode>: Character string
URL to be decoded.
<Encoding/decoding format>: Integer constant
Specifies the type of encoding. This parameter must be the same as the one used when encoding. | |
encodeURLToAnsi | URL format. The encoded text only contains characters allowed in a URL. The decoded text is an ANSI string. This constant corresponds to the encodeURLFromAnsi constant used in URLEncode. |
encodeURLToUnicode | URL format. The encoded text only contains characters allowed in a URL. The decoded text is a Unicode string. This constant corresponds to the encodeURLFromUnicode constant used in URLEncode. |
encodeURLToUTF8 (Default value) | URL format. The encoded text only contains characters allowed in a URL. The decoded text is a UTF-8 string. This constant corresponds to the encodeURLFromUTF8 constant used in URLEncode. |
Remarks
Characters allowed in an encoded URL
The list of characters allowed in an encoded URL is as follows:
| | | | |
; | / | ? | : | @ |
& | = | + | $ | , |
- | _ | . | ! | ~ |
* | ' | ( | | | ) |
% | # | digits | letters (uppercase and lowercase characters) | |
- Decoding an empty URL (empty string) returns an empty URL.
- The %26%238364%3B string whose value is #8364; is replaced with the € symbol.
- The % characters followed by invalid characters are ignored.