(rontolisp) docs
← Functions

rontolisp:url-decode

(rontolisp:url-decode string)

Decodes a percent-encoded (URL-encoded) string: each %XX escape becomes a byte and the byte sequence is decoded as UTF-8 (multi-byte escapes reassemble into one character), and + becomes a space — the query-string convention. The inverse is rontolisp:url-encode.

An invalid escape (% not followed by two hex digits, or bytes that are not valid UTF-8) signals an error:

> (rontolisp:url-decode "%2")
Error: url-decode: unterminated percent escape

Backend support

Works on every backend and in every WASM mode (Preview 1 included): the library is written in rontolisp itself and is compiled into the program when used. rontolisp:query-params and rontolisp:query-param decode keys and values with it automatically.