Skip to content

Commit

Permalink
doc: add explanations for querystring
Browse files Browse the repository at this point in the history
 - add an article: `decode a non-utf8 string`
 - explain default and fallback behaviour of `querystring.unescape`

PR-URL: nodejs/node-v0.x-archive#9259
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
  • Loading branch information
robertkowalski authored and cjihrig committed Mar 3, 2015
1 parent 8fb711e commit c811069
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/api/querystring.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Options object may contain `maxKeys` property (equal to 1000 by default), it'll
be used to limit processed keys. Set it to 0 to remove key count limitation.

Options object may contain `decodeURIComponent` property (`querystring.unescape` by default),
it can be used to decode `non-utf8` encoding string if necessary.
it can be used to decode a `non-utf8` encoding string if necessary.

Example:

Expand All @@ -67,3 +67,7 @@ provided so that it could be overridden if necessary.

The unescape function used by `querystring.parse`,
provided so that it could be overridden if necessary.

It will try to use `decodeURIComponent` in the first place,
but if that fails it falls back to a safer equivalent that
doesn't throw on malformed URLs.

0 comments on commit c811069

Please sign in to comment.