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.
percent_decode :: (text: string, plus_is_space := false) -> string
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.
Parameters
- text: string
- plus_is_space := false
Returns
- string