Decodes %XX escapes (and + as a space when plus_is_space, which forms and queries use but
paths do not). The text itself is returned, with no allocation, when there is nothing to
decode; otherwise the result comes from context.allocator. A % not followed by two hex
digits stays as it is.
assert(percent_decode("a%20b") == "a b");
assert(percent_decode("a+b", plus_is_space = true) == "a b");
assert(percent_decode("100%") == "100%");Doesn't run in the browser (skipped on wasm).
percent_decode :: (text: string, plus_is_space := false) -> string
Parameters
- text: string
- plus_is_space := false
Returns
- string