(key, value) tuples.parseQueryParamsDecoded
Parse a query string into key/value pairs with optional form-style decoding.
Performs the same splitting semantics as parseQueryParams, then applies:
- If
plusAsSpaceis true, maps `+` to space (U+0020) before percent-decoding,
emulating application/x-www-form-urlencoded behavior.
- Percent-decodes
%HHescapes in both keys and values usingpctDecode.
Parameters
q | Query string without the leading `?`. |
plusAsSpace | If true, interpret `+` as space prior to decoding. |
Returns
Array of decoded
Examples
import std.typecons : tuple;
auto p1 = parseQueryParamsDecoded("q=hello%20world", false);
assert(p1[0] == tuple("q", "hello world"));
auto p2 = parseQueryParamsDecoded("q=hello+world+%2B&u=%E2%82%AC", true);
assert(p2[0] == tuple("q", "hello world +"));
assert(p2[1] == tuple("u", "€"));