-
Notifications
You must be signed in to change notification settings - Fork 1
UrlEncode
String functions UrlEncode
NOT YET IMPLEMENTED: as of GeoDMS 20.8.0 this operator name is registered but reserved; calling it results in There is no implemented operator for operator name .... This page describes the intended behaviour.
The UrlEncode function encodes strings for safe use in URLs by escaping special characters.
UrlEncode(strings: E->String) -> E->String
Converts strings to URL-safe format by replacing special characters with percent-encoded sequences (e.g., space becomes %20, & becomes %26).
Characters that are encoded include:
- Spaces and control characters
- Reserved URL characters:
!,#,$,&,',(,),*,+,,,/,:,;,=,?,@,[,] - Non-ASCII characters
Characters that remain unencoded:
- Letters (A-Z, a-z)
- Digits (0-9)
- Unreserved characters:
-,_,.,~
| argument | description | type |
|---|---|---|
| strings | Input strings to encode | E->String |
Time complexity: O(n × L) where n is the number of strings and L is the average string length.
Encoded strings are typically longer than input strings (each special character becomes 3 characters).
unit<uint32> QueryParams: nrofrows = 3;
attribute<String> values (QueryParams) := union_data(QueryParams,
'hello world',
'price=100&tax=20',
'name=Müller'
);
attribute<String> encoded (QueryParams) := UrlEncode(values);
// encoded = {'hello%20world', 'price%3D100%26tax%3D20', 'name%3DM%C3%BCller'}
// Building URL query string
parameter<String> base_url := 'https://api.example.com/search?q=';
attribute<String> full_url (QueryParams) := base_url + encoded;
- UrlDecode - reverse operation
- HtmlEncode - for HTML content
- String functions
7.0
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.