Bug 172282 - Apply IDNA ToASCII even when the input is ASCII
Summary: Apply IDNA ToASCII even when the input is ASCII
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-18 03:43 PDT by Anne van Kesteren
Modified: 2022-08-08 17:32 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anne van Kesteren 2017-05-18 03:43:35 PDT
If ToASCII is not applied to all input (even ASCII) rules are not uniformly enforced. E.g., it means that Unicode labels can be 63 code points after conversion to Punycode, whereas ASCII labels have no limit.

Making it uniform likely requires removing some rules for non-ASCII input, as the web depends on being able to place hyphens in the 3rd and 4th place of a label, and likely also depends on leading and trailing hyphens.

An update to Unicode's UTS #46 likely makes more of this configurable: http://www.unicode.org/reports/tr46/tr46-18.html.

https://url.spec.whatwg.org/#idna already requires UseSTD3ASCIIRules and VerifyDnsLength to be set to false. I propose that the URL Standard also sets CheckHyphens (needed for compatibility) and CheckJoiners (seems silly to restrict a subset of emojis) to false and continues to require applying ToASCII (domain to ASCII as the URL Standard calls it) to all input.

Tests: https://github.com/w3c/web-platform-tests/pull/5976.
Comment 1 Ahmad Saleem 2022-08-08 17:32:07 PDT
Safari is only browser to pass all test cases:

https://wpt.fyi/results/url/toascii.window.html?label=master&label=experimental&aligned&view=subtest&q=toascii

I am marking this as RESOLVED CONFIGURATION CHANGED. If something else is needed, please reopen and ignore my comment. Thanks!