summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kowalski <rok@kowalski.gd>2015-02-21 01:03:14 +0100
committerJulien Gilli <julien.gilli@joyent.com>2015-02-25 12:00:53 -0800
commit5d821fe0beec775fa3fbb0fd7ac1cbc3fff983c5 (patch)
tree2fe55c47d56c9fb7a4dac6de933c79b9a0cf5ef8
parentf1bf88395926d84fb75cc055849624caad8f0144 (diff)
downloadnode-5d821fe0beec775fa3fbb0fd7ac1cbc3fff983c5.tar.gz
doc: add explanations for querystring
- add an article: `decode a non-utf8 string` - explain default and fallback behaviour of `querystring.unescape` PR-URL: https://github.com/joyent/node/pull/9259 Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
-rw-r--r--doc/api/querystring.markdown6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/api/querystring.markdown b/doc/api/querystring.markdown
index ed1ce9f7c..5f0203303 100644
--- a/doc/api/querystring.markdown
+++ b/doc/api/querystring.markdown
@@ -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:
@@ -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.