ns_parsequery - Parse a URL query string into an ns_set
Parse HTTP query parameters.
This command parses the specified HTTP querystring into an ns_set, which is returned. The keys and values will be decoded based by the rules used for ns_urlencode. In case the query cannot be parsed to the charset, an exception is raised (with exception code NS_INVALID_UTF8).
The option -charset can be used to specify the character set of the encode operation.
The option -fallbackcharset can be used to specify an alternative character set when the conversion of the querystring leads to invalid UTF-8. Instead of raising an exception, a second attempt of decoding the query string is made with the fallback charset. Note that the fallback charset can be provided as well via the configuration parameter formfallbackcharset. For more details, see ns_getform.
% set s [ns_parsequery "msg=Hello+World%21&a=b&a=b&c=d"] d0 % ns_set array $s msg {Hello World!} a b a b c d