diff options
author | Daniel Wang <wangyang0123@gmail.com> | 2016-05-17 18:58:03 +0800 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2016-05-19 11:58:53 +0200 |
commit | b90c52e38d47952bf6bef59d9a1c116b1972b8d9 (patch) | |
tree | 48601c42f16f75da491d3cdaa8ca3cf94e0ad5f3 /doc/api/punycode.md | |
parent | 4fe1d6e75fe6daa19150038c7fdb2de0f91c10fa (diff) | |
download | android-node-v8-b90c52e38d47952bf6bef59d9a1c116b1972b8d9.tar.gz android-node-v8-b90c52e38d47952bf6bef59d9a1c116b1972b8d9.tar.bz2 android-node-v8-b90c52e38d47952bf6bef59d9a1c116b1972b8d9.zip |
doc: add `added:` information for punycode
PR-URL: https://github.com/nodejs/node/pull/6805
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/punycode.md')
-rw-r--r-- | doc/api/punycode.md | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/doc/api/punycode.md b/doc/api/punycode.md index 7f3617c12d..f94ecb16bf 100644 --- a/doc/api/punycode.md +++ b/doc/api/punycode.md @@ -2,11 +2,14 @@ Stability: 2 - Stable -[Punycode.js][] is bundled with Node.js v0.6.2+. Use `require('punycode')` to +[Punycode.js][] is bundled with Node.js v0.5.1+. Use `require('punycode')` to access it. (To use it with other Node.js versions, use npm to install the `punycode` module first.) ## punycode.decode(string) +<!-- YAML +added: v0.5.1 +--> Converts a Punycode string of ASCII-only symbols to a string of Unicode symbols. @@ -17,6 +20,9 @@ punycode.decode('--dqo34k'); // '☃-⌘' ``` ## punycode.encode(string) +<!-- YAML +added: v0.5.1 +--> Converts a string of Unicode symbols to a Punycode string of ASCII-only symbols. @@ -27,6 +33,9 @@ punycode.encode('☃-⌘'); // '--dqo34k' ``` ## punycode.toASCII(domain) +<!-- YAML +added: v0.6.1 +--> Converts a Unicode string representing a domain name to Punycode. Only the non-ASCII parts of the domain name will be converted, i.e. it doesn't matter if @@ -39,6 +48,9 @@ punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' ``` ## punycode.toUnicode(domain) +<!-- YAML +added: v0.6.1 +--> Converts a Punycode string representing a domain name to Unicode. Only the Punycoded parts of the domain name will be converted, i.e. it doesn't matter if @@ -51,8 +63,14 @@ punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' ``` ## punycode.ucs2 +<!-- YAML +added: v0.7.0 +--> ### punycode.ucs2.decode(string) +<!-- YAML +added: v0.7.0 +--> Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally][], this function @@ -66,6 +84,9 @@ punycode.ucs2.decode('\uD834\uDF06'); // [0x1D306] ``` ### punycode.ucs2.encode(codePoints) +<!-- YAML +added: v0.7.0 +--> Creates a string based on an array of numeric code point values. @@ -75,6 +96,9 @@ punycode.ucs2.encode([0x1D306]); // '\uD834\uDF06' ``` ## punycode.version +<!-- YAML +added: v0.6.1 +--> A string representing the current Punycode.js version number. |