{"_id":"idna-uts46","_rev":"4605485","name":"idna-uts46","description":"A UTS #46 processing algorithm for IDNA2008 strings","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"jcranmer","email":""}],"time":{"modified":"2026-04-10T17:35:59.000Z","created":"2015-09-26T06:57:37.161Z","1.1.0":"2017-04-24T05:23:17.579Z","1.0.1":"2015-09-26T07:02:21.325Z","1.0.0":"2015-09-26T06:57:37.161Z"},"users":{},"author":{"name":"Joshua Cranmer","email":"Pidgeot18@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/jcranmer/idna-uts46.git"},"versions":{"1.1.0":{"name":"idna-uts46","version":"1.1.0","description":"A UTS #46 processing algorithm for IDNA2008 strings","main":"uts46.js","keywords":["unicode","idn","idna","domain"],"scripts":{"test":"grunt test"},"repository":{"type":"git","url":"git+https://github.com/jcranmer/idna-uts46.git"},"author":{"name":"Joshua Cranmer","email":"Pidgeot18@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/jcranmer/idna-uts46/issues"},"homepage":"https://github.com/jcranmer/idna-uts46","dependencies":{"punycode":"^2.1.0"},"devDependencies":{"chai":"^3.2.0","grunt":"^1.0.1","grunt-mocha-istanbul":"^5.0.2","grunt-mocha-test":"^0.13.2","istanbul":"^0.4.5","mocha":"^3.2.0","requirejs-browser":"^2.1.9"},"engines":{"node":">=4.0.0"},"gitHead":"5677a1688b8df51a7b6d01ecdaa7f42b4c1e56d8","_id":"idna-uts46@1.1.0","_shasum":"be098b2b7c1cabfbef87a8b80f626fac37366aea","_from":".","_npmVersion":"4.1.1","_nodeVersion":"4.7.2","_npmUser":{"name":"jcranmer","email":"Pidgeot18@gmail.com"},"maintainers":[{"name":"jcranmer","email":""}],"dist":{"shasum":"be098b2b7c1cabfbef87a8b80f626fac37366aea","size":100149,"noattachment":false,"key":"/idna-uts46/-/idna-uts46-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/idna-uts46/download/idna-uts46-1.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/idna-uts46-1.1.0.tgz_1493011396946_0.33569382643327117"},"directories":{},"publish_time":1493011397579,"_hasShrinkwrap":false,"_cnpm_publish_time":1493011397579,"_cnpmcore_publish_time":"2021-12-16T22:30:45.693Z"},"1.0.1":{"name":"idna-uts46","version":"1.0.1","description":"A UTS #46 processing algorithm for IDNA2008 strings","main":"uts46.js","keywords":["unicode","idn","idna","domain"],"scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/jcranmer/idna-uts46"},"author":{"name":"Joshua Cranmer","email":"Pidgeot18@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/jcranmer/idna-uts46/issues"},"homepage":"https://github.com/jcranmer/idna-uts46","dependencies":{"punycode":"^1.3.2"},"devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","istanbul":"^0.3.20","mocha":"^2.3.2","requirejs-browser":"^2.1.9"},"engines":{"node":">=4.0.0"},"gitHead":"16ad8454052e21a63760daec0f3fddf093c58a9d","_id":"idna-uts46@1.0.1","_shasum":"bfa1d44b22937ce14e106463ac814e9d1449b777","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jcranmer","email":"Pidgeot18@gmail.com"},"maintainers":[{"name":"jcranmer","email":""}],"dist":{"shasum":"bfa1d44b22937ce14e106463ac814e9d1449b777","size":98685,"noattachment":false,"key":"/idna-uts46/-/idna-uts46-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/idna-uts46/download/idna-uts46-1.0.1.tgz"},"directories":{},"publish_time":1443250941325,"_hasShrinkwrap":false,"_cnpm_publish_time":1443250941325,"_cnpmcore_publish_time":"2021-12-16T22:30:46.038Z"},"1.0.0":{"name":"idna-uts46","version":"1.0.0","description":"A UTS #46 processing algorithm for IDNA2008 strings","main":"uts46.js","keywords":["unicode","idn","idna","domain"],"scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/jcranmer/idna-uts46"},"author":{"name":"Joshua Cranmer","email":"Pidgeot18@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/jcranmer/idna-uts46/issues"},"homepage":"https://github.com/jcranmer/idna-uts46","dependencies":{"punycode":"^1.3.2"},"devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","istanbul":"^0.3.20","mocha":"^2.3.2","requirejs-browser":"^2.1.9"},"engines":{"node":">=4.0.0"},"gitHead":"c40a67a770708478315311b908953e6e697def9a","_id":"idna-uts46@1.0.0","_shasum":"28e5b875c93d715582163b16c646aabf34beb1fd","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jcranmer","email":"Pidgeot18@gmail.com"},"maintainers":[{"name":"jcranmer","email":""}],"dist":{"shasum":"28e5b875c93d715582163b16c646aabf34beb1fd","size":98623,"noattachment":false,"key":"/idna-uts46/-/idna-uts46-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/idna-uts46/download/idna-uts46-1.0.0.tgz"},"directories":{},"publish_time":1443250657161,"_hasShrinkwrap":false,"_cnpm_publish_time":1443250657161,"_cnpmcore_publish_time":"2021-12-16T22:30:46.384Z"}},"readme":"# IDNA-UTS #46 in JavaScript\n\nThe [JS Punycode converter library](https://github.com/bestiejs/punycode.js/) is\na great tool for handling Unicode domain names, but it only implements the\nPunycode encoding of domain labels, not the full IDNA algorithm. In simple\ncases, a mere conversion to lowercase text before input would seem sufficient,\nbut the real mapping for strings is far more complex. This library implements\nthe full mapping for these strings, as defined by\n[UTS #46](http://unicode.org/reports/tr46/).\n\n\n## IDNA mess for dummies\n\nUnfortunately, the situation of internationalized domain names is rather\ncomplicated by the existence of multiple incompatible standards (IDNA2003 and\nIDNA2008, predominantly). While UTS #46 tries to bridge the incompatibility,\nthere are four characters which cannot be so bridged: ß (the German sharp s),\nς (Greek final sigma), and the ZWJ and ZWNJ characters. These are handled\ndifferently depending on the mode; in ``transitional`` mode, these strings are\nmapped to different ones, preserving capability with IDNA2003; in\n``nontransitional`` mode, these strings are mapped to themselves, in accordance\nwith IDNA2008.\n\nPresently, this library uses ``transitional`` mode, compatible with all known\nbrowser implementations at this point. It is expected that, in the future, this\nwill be changed to ``nontransitional`` mode.\n\n`It is highly recommended that you use the ASCII form of the label for storing\nor comparing strings.`\n\n## API\n\n### `uts46.toAscii(domain, options={transitional: false, useStd3ASCII: false, verifyDnsLength: false })`\n\nConverts a domain name to the correct ASCII label. The second parameter is an\noptional options parameter, which has two configurable options. The\n`transitional` option controls whether or not transitional processing (see the\nIDNA mess for dummies section for more details) is requested, defaulting to\nfalse. The `useStd3ASCII` option controls whether or not characters that are\nillegal in domain names per the DNS specification should be omitted. The\n`verifyDnsLength` option controls whether or not the resulting DNS label should\nbe checked for length validity (i.e., no empty components and not too long). The\noptions parameter and its associated fields are all optional and should be\nomitted for most users.\n\n```js\nuts46.toAscii('öbb.at'); // 'xn-bb-eka.at'\nuts46.toAscii('ÖBB.AT'); // 'xn-bb-eka.at'\nuts46.toAscii('XN-BB-EKA.AT'); // 'xn-bb-eka.at'\nuts46.toAscii('faß.de'); // 'fass.de'\nuts46.toAscii('faß.de', {transitional: true}); // 'fass.de'\nuts46.toAscii('faß.de', {transitional: false}); // 'xn--fa-hia.de'\nuts46.toAscii('xn--fa-hia.de', {transitional: false}); // 'xn--fa-hia.de'\nuts46.toAscii(String.fromCodePoint(0xd0000)); // Error (as it is unassigned)\n```\n\n### `uts46.toUnicode(domain, options={useStd3ASCII: false})`\n\nConverts a domain name to a normalized Unicode label. The second parameter is an\noptional options parameter. The `useStd3ASCII` option controls whether or not\ncharacters that are illegal in domain names per the DNS specification should be\nomitted. The latter parameter is optional and should be omitted for most users.\n\n```js\nuts46.toUnicode('xn-bb-eka.at'); // 'öbb.at'\nuts46.toUnicode('ÖBB.AT'); // 'öbb.at'\nuts46.toUnicode('O\\u0308BB.AT'); // 'öbb.at'\nuts46.toUnicode('faß.de'); // 'faß.de'\nuts46.toUnicode('xn--fa-hia.de'); // 'faß.de'\nuts46.toUnicode('﷼'); // \"ریال\"\nuts46.toUnicode(String.fromCodePoint(0xd0000)); // Error (as it is unassigned)\n```\n\n## Known issues\n\nIt also does not try to implement the Bidi and contextual rules for validation:\nthese do not affect any mapping of the domain names; instead, they restrict the\nset of valid domain names. Since registrars shouldn't be accepting these names\nin the first place, a domain that violates these rules will simply fail to\nresolve.\n","_attachments":{},"homepage":"https://github.com/jcranmer/idna-uts46","bugs":{"url":"https://github.com/jcranmer/idna-uts46/issues"},"license":"MIT"}