jsdom / tr46

An implementation of the Unicode UTS #46: Unicode IDNA Compatibility Processing.
MIT License
32 stars 14 forks source link

Use punycode more appropriately #7

Closed domenic closed 7 years ago

domenic commented 7 years ago

Previously we used punycode's toASCII and toUnicode exports, which implement incomplete parts of TR46 themselves (with buggy "is ASCII" checks until recently; see #5 and https://github.com/bestiejs/punycode.js/issues/59. Now we usethe lower-level encode and decode exports, with appropriate tweaks to the surrounding code to more fully conform to the surrounding TR46 algorithm steps.

Fixes #5.


Still 488 failing tests before and after. However this improves jsdom/whatwg-url results on the host parser tests at https://github.com/w3c/web-platform-tests/pull/4504 to only 3 failures none of which seem tr46 related.

Sebmaster commented 7 years ago

Regarding the test failures: A lot of that is just the inadequate description of the test suite by Unicode. Getting failures down is basically only a heuristic.

Sebmaster commented 7 years ago

Should also switch to punycode.js proper (the package) instead of using the node built-in module while we're at it.