UrlDecode - ObjectVision/GeoDMS GitHub Wiki
String functions UrlDecode
The UrlDecode function decodes URL-encoded strings back to their original form.
UrlDecode(strings: E->String) -> E->String
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 &). It is the exact inverse of UrlEncode.
Common encodings that are decoded:
- %20 → space
- %26 → &
- %3D → =
- %2F → /
- %3A → :
- %3F → ?
- A plus sign (+) is decoded to a space; a literal plus must therefore be encoded as %2B
- Percent-encoded non-ASCII bytes are passed through as bytes, so UTF-8 sequences (e.g. %C3%BC) decode to UTF-8 text
| argument | description | type |
|---|---|---|
| strings | URL-encoded strings to decode | E->String |
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.
- An invalid percent sequence (e.g. %ZZ, or a % at the end of the string) is an error: UrlDecode: invalid escape code
- UTF-8 encoded sequences are properly decoded
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'}
- UrlEncode - reverse operation
- HtmlDecode - for HTML content
- String functions
7.0