URLDecode()
Decodes an URL-encoded string.
URLDecode( string=string, charset=string, strict=boolean );
Returns: String
Usage Notes
With Lucee 6.1, the underlying decoder was switched to use Apache Common Codec, which is stricter but more standards compliant.
Use the strict=false
argument for the older behaviour, which strips out invalid encodings and doesn't throw an exception.
By default, Lucee attempts to decode all values passed in the url
and form
scopes, using strict mode. If an decoding error occurs, Lucee passes the raw value thru.
Examples
encoded_string = "https%3A%2F%2Fdev%2Elucee%2Eorg%2Ft%2Fwelcome%2Dto%2Dlucee%2Ddev%2F2064";
dump(URLDecode(encoded_string)); // https://dev.lucee.org/t/welcome-to-lucee-dev/2064
See also
- Encode/Decode
- URLEncode()
- string.uRLDecode()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)