UrlDecode
string-functions UrlDecode
The UrlDecode function decodes URL-encoded strings back to their original form.
syntax
UrlDecode(strings: E->String) -> E->String
definition
Converts URL-encoded strings back to their original format by replacing percent-encoded sequences with the corresponding characters (e.g., %20 becomes space, %26 becomes &).
Common encodings that are decoded:
- %20 → space
- %26 → &
- %3D → =
- %2F → /
- %3A → :
- %3F → ?
- Plus sign (+) may or may not be decoded to space depending on the encoding standard used
arguments
| argument | description | type |
|---|---|---|
| strings | URL-encoded strings to decode | E->String |
performance
Time complexity: O(n × L) where n is the number of strings and L is the average string length.
Decoded strings are typically shorter than input strings.
conditions
- Invalid percent sequences (e.g., %ZZ) may produce undefined results
- UTF-8 encoded sequences are properly decoded
example
unit<uint32> EncodedParams: nrofrows = 3;
attribute<String> encoded (EncodedParams) := union_data(EncodedParams,
'hello%20world',
'price%3D100%26tax%3D20',
'name%3DM%C3%BCller'
);
attribute<String> decoded (EncodedParams) := UrlDecode(encoded);
// decoded = {'hello world', 'price=100&tax=20', 'name=Müller'}
see also
- urlencode - reverse operation
- htmldecode - for HTML content
- string-functions
since version
7.0