URL_ENCODE()
All functions > STRING > URL_ENCODE()
Encodes a string for safe use in URL components using percent-encoding (RFC 3986).
Signatures
Returns: Percent-encoded string
URL_ENCODE(string: VARCHAR) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | Text to encode |
Notes
- Non-reserved characters may remain unescaped; reserved and non-ASCII characters are escaped as
%HH - Returns NULL if the input is NULL (use
NULL(VARCHAR); bareNULLfails inference) - Pair with
URL_DECODEto recover the original string
See also
Examples
FeatureQL
SELECT
f1 := URL_ENCODE('a b'), -- Space becomes percent-encoding
f2 := URL_ENCODE(''), -- Empty string
f3 := URL_ENCODE(NULL(VARCHAR)) -- NULL yields NULL
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR |
|---|---|---|
| a%20b | (empty) | NULL |
On this page