Repository navigation
Conversation
Regression tests covering: - #104: Hangul LV syllable followed by trailing consonant composing to LVT syllable under NFC (U+AC00 U+11A8 -> U+AC01) - ada-url/ada#1277: RFC 5892 ContextJ adjacency and RFC 5893 CheckBidi validation in labels containing joiners (ZWNJ/ZWJ) Fixes #104 Reported by Ömer Akalın (@otaliptus) and Hayder Tirmazi (@jadidbourbaki) in idna#104. Reported by Mert Can Altin (@mertcanaltin) in ada#1277. Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.com>
RFC 5893 applies its six conditions to every label once the domain contains an RTL label. ASCII labels such as "1" in "1.ا" were skipped, so ToASCII accepted hostnames that UTS #46 rejects. Regression tests also lock Hangul LV+T composition under NFC (U+AC00 U+11A8 -> xn--p39a) and ContextJ checks that must not skip a later joiner or the Bidi rule. Fixes #104 Reported by Ömer Akalın (@otaliptus) and Hayder Tirmazi (@jadidbourbaki). The CheckBidi gap was reported by Mert Can Altin (@mertcanaltin) in ada-url/ada#1277. Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.com>
2 of 3 tasks
Member
Author
|
Vendored into ada in ada-url/ada#1318. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CheckBidi (RFC 5893) applies to every label once a domain contains an RTL label.
to_asciivalidated Bidi only for labels that themselves contained R, AL, or AN, and it skipped all-ASCII labels, so1.اandا.1awere accepted. Those labels now fail rule 1. An LTR label that starts with L and ends with L or EN, such asexample.ا, still converts.The Hangul LV+T NFC fast path (
U+AC00 U+11A8composes toU+AC01,xn--p39arather thanxn--rud7310f) and the ContextJ loop (a joiner must notreturnbefore later joiners and CheckBidi run; ZWNJ must sit between joining types L/D and R/D) are covered by regression tests against UTS #46 / IdnaTestV2 and the WPTtoascii.jsonfixture.Fixes #104
Reported by Ömer Akalın (@otaliptus) and Hayder Tirmazi (@jadidbourbaki) in idna#104.
The CheckBidi gap was reported by Mert Can Altin (@mertcanaltin) in ada-url/ada#1277.
Test plan
ctestin ada-url/idna (IdnaTestV2, WPT toascii, Hangul LV+T, ContextJ, Bidi-domain cases)