Skip to content

Commit c811069

Browse files
robertkowalskicjihrig
authored andcommitted
doc: add explanations for querystring
- 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 <[email protected]>
1 parent 8fb711e commit c811069

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/api/querystring.markdown

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Options object may contain `maxKeys` property (equal to 1000 by default), it'll
4343
be used to limit processed keys. Set it to 0 to remove key count limitation.
4444

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

4848
Example:
4949

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

6868
The unescape function used by `querystring.parse`,
6969
provided so that it could be overridden if necessary.
70+
71+
It will try to use `decodeURIComponent` in the first place,
72+
but if that fails it falls back to a safer equivalent that
73+
doesn't throw on malformed URLs.

0 commit comments

Comments
 (0)