{
  "source": "doc/api/punycode.md",
  "modules": [
    {
      "textRaw": "Punycode",
      "name": "punycode",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p><a href=\"https://mths.be/punycode\">Punycode.js</a> is bundled with Node.js v0.5.1+. Use <code>require(&#39;punycode&#39;)</code> to\naccess it. (To use it with other Node.js versions, use npm to install the\n<code>punycode</code> module first.)</p>\n",
      "methods": [
        {
          "textRaw": "punycode.decode(string)",
          "type": "method",
          "name": "decode",
          "meta": {
            "added": [
              "v0.5.1"
            ]
          },
          "desc": "<p>Converts a Punycode string of ASCII-only symbols to a string of Unicode symbols.</p>\n<pre><code class=\"lang-js\">// decode domain name parts\npunycode.decode(&#39;maana-pta&#39;); // &#39;mañana&#39;\npunycode.decode(&#39;--dqo34k&#39;); // &#39;☃-⌘&#39;\n</code></pre>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "string"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "punycode.encode(string)",
          "type": "method",
          "name": "encode",
          "meta": {
            "added": [
              "v0.5.1"
            ]
          },
          "desc": "<p>Converts a string of Unicode symbols to a Punycode string of ASCII-only symbols.</p>\n<pre><code class=\"lang-js\">// encode domain name parts\npunycode.encode(&#39;mañana&#39;); // &#39;maana-pta&#39;\npunycode.encode(&#39;☃-⌘&#39;); // &#39;--dqo34k&#39;\n</code></pre>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "string"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "punycode.toASCII(domain)",
          "type": "method",
          "name": "toASCII",
          "meta": {
            "added": [
              "v0.6.1"
            ]
          },
          "desc": "<p>Converts a Unicode string representing a domain name to Punycode. Only the\nnon-ASCII parts of the domain name will be converted, i.e. it doesn&#39;t matter if\nyou call it with a domain that&#39;s already in ASCII.</p>\n<pre><code class=\"lang-js\">// encode domain names\npunycode.toASCII(&#39;mañana.com&#39;); // &#39;xn--maana-pta.com&#39;\npunycode.toASCII(&#39;☃-⌘.com&#39;); // &#39;xn----dqo34k.com&#39;\n</code></pre>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "domain"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "punycode.toUnicode(domain)",
          "type": "method",
          "name": "toUnicode",
          "meta": {
            "added": [
              "v0.6.1"
            ]
          },
          "desc": "<p>Converts a Punycode string representing a domain name to Unicode. Only the\nPunycoded parts of the domain name will be converted, i.e. it doesn&#39;t matter if\nyou call it on a string that has already been converted to Unicode.</p>\n<pre><code class=\"lang-js\">// decode domain names\npunycode.toUnicode(&#39;xn--maana-pta.com&#39;); // &#39;mañana.com&#39;\npunycode.toUnicode(&#39;xn----dqo34k.com&#39;); // &#39;☃-⌘.com&#39;\n</code></pre>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "domain"
                }
              ]
            }
          ]
        }
      ],
      "properties": [
        {
          "textRaw": "punycode.ucs2",
          "name": "ucs2",
          "meta": {
            "added": [
              "v0.7.0"
            ]
          },
          "modules": [
            {
              "textRaw": "punycode.ucs2.decode(string)",
              "name": "punycode.ucs2.decode(string)",
              "meta": {
                "added": [
                  "v0.7.0"
                ]
              },
              "desc": "<p>Creates an array containing the numeric code point values of each Unicode\nsymbol in the string. While <a href=\"https://mathiasbynens.be/notes/javascript-encoding\">JavaScript uses UCS-2 internally</a>, this function\nwill convert a pair of surrogate halves (each of which UCS-2 exposes as\nseparate characters) into a single code point, matching UTF-16.</p>\n<pre><code class=\"lang-js\">punycode.ucs2.decode(&#39;abc&#39;); // [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 tetragram for centre:\npunycode.ucs2.decode(&#39;\\uD834\\uDF06&#39;); // [0x1D306]\n</code></pre>\n",
              "type": "module",
              "displayName": "punycode.ucs2.decode(string)"
            },
            {
              "textRaw": "punycode.ucs2.encode(codePoints)",
              "name": "punycode.ucs2.encode(codepoints)",
              "meta": {
                "added": [
                  "v0.7.0"
                ]
              },
              "desc": "<p>Creates a string based on an array of numeric code point values.</p>\n<pre><code class=\"lang-js\">punycode.ucs2.encode([0x61, 0x62, 0x63]); // &#39;abc&#39;\npunycode.ucs2.encode([0x1D306]); // &#39;\\uD834\\uDF06&#39;\n</code></pre>\n",
              "type": "module",
              "displayName": "punycode.ucs2.encode(codePoints)"
            }
          ]
        },
        {
          "textRaw": "punycode.version",
          "name": "version",
          "meta": {
            "added": [
              "v0.6.1"
            ]
          },
          "desc": "<p>A string representing the current Punycode.js version number.</p>\n"
        }
      ],
      "type": "module",
      "displayName": "Punycode"
    }
  ]
}
