-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong answer on "\u001fx", apparently #5
Comments
The problem is this line in the spec:
which we translate as: labels = labels.map(function(l) {
try {
return punycode.toASCII(l);
} catch(e) {
result.error = true;
return l;
}
}); It appears we are making an assumption that punycode.toASCII will be a no-op for ASCII characters (including |
Same bug in another tr46 library, at least according to source inspection: https://github.com/jcranmer/idna-uts46/blob/master/uts46.js#L92 It at least seems people are assuming that punycode.toASCII is a no-op on ASCII input. |
Previously we used punycode's toASCII and toUnicode exports, which implement incomplete parts of TR46 themselves (with buggy "is ASCII" checks until recently; see jsdom#5 and mathiasbynens/punycode.js#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 jsdom#5.
Previously we used punycode's toASCII and toUnicode exports, which implement incomplete parts of TR46 themselves (with buggy "is ASCII" checks until recently; see jsdom#5 and mathiasbynens/punycode.js#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 jsdom#5.
Previously we used punycode's toASCII and toUnicode exports, which implement incomplete parts of TR46 themselves (with buggy "is ASCII" checks until recently; see jsdom#5 and mathiasbynens/punycode.js#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. This also upgrades to the latest punycode.js published on npm, instead of using the now-deprecated one bundled with Node.js. Fixes jsdom#5.
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 mathiasbynens/punycode.js#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. This also upgrades to the latest punycode.js published on npm, instead of using the now-deprecated one bundled with Node.js. Fixes #5.
Continued from web-platform-tests/wpt#4504 (comment) . Repro:
outputs
'xn--\u001fx-'
whereas it should output just'\u001fx'
according to @annevk's reading in web-platform-tests/wpt#4504 (comment) . Updates to follow...The text was updated successfully, but these errors were encountered: