2
2
3
3
Stability: 2 - Stable
4
4
5
- [ Punycode.js] [ ] is bundled with Node.js v0.6.2 +. Use ` require('punycode') ` to
5
+ [ Punycode.js] [ ] is bundled with Node.js v0.5.1 +. Use ` require('punycode') ` to
6
6
access it. (To use it with other Node.js versions, use npm to install the
7
7
` punycode ` module first.)
8
8
9
9
## punycode.decode(string)
10
+ <!-- YAML
11
+ added: v0.5.1
12
+ -->
10
13
11
14
Converts a Punycode string of ASCII-only symbols to a string of Unicode symbols.
12
15
@@ -17,6 +20,9 @@ punycode.decode('--dqo34k'); // '☃-⌘'
17
20
```
18
21
19
22
## punycode.encode(string)
23
+ <!-- YAML
24
+ added: v0.5.1
25
+ -->
20
26
21
27
Converts a string of Unicode symbols to a Punycode string of ASCII-only symbols.
22
28
@@ -27,6 +33,9 @@ punycode.encode('☃-⌘'); // '--dqo34k'
27
33
```
28
34
29
35
## punycode.toASCII(domain)
36
+ <!-- YAML
37
+ added: v0.6.1
38
+ -->
30
39
31
40
Converts a Unicode string representing a domain name to Punycode. Only the
32
41
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'
39
48
```
40
49
41
50
## punycode.toUnicode(domain)
51
+ <!-- YAML
52
+ added: v0.6.1
53
+ -->
42
54
43
55
Converts a Punycode string representing a domain name to Unicode. Only the
44
56
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'
51
63
```
52
64
53
65
## punycode.ucs2
66
+ <!-- YAML
67
+ added: v0.7.0
68
+ -->
54
69
55
70
### punycode.ucs2.decode(string)
71
+ <!-- YAML
72
+ added: v0.7.0
73
+ -->
56
74
57
75
Creates an array containing the numeric code point values of each Unicode
58
76
symbol in the string. While [ JavaScript uses UCS-2 internally] [ ] , this function
@@ -66,6 +84,9 @@ punycode.ucs2.decode('\uD834\uDF06'); // [0x1D306]
66
84
```
67
85
68
86
### punycode.ucs2.encode(codePoints)
87
+ <!-- YAML
88
+ added: v0.7.0
89
+ -->
69
90
70
91
Creates a string based on an array of numeric code point values.
71
92
@@ -75,6 +96,9 @@ punycode.ucs2.encode([0x1D306]); // '\uD834\uDF06'
75
96
```
76
97
77
98
## punycode.version
99
+ <!-- YAML
100
+ added: v0.6.1
101
+ -->
78
102
79
103
A string representing the current Punycode.js version number.
80
104
0 commit comments