Skip to content

Commit cfeb1a4

Browse files
committed
[idan] Improve Bidi Rules implementation
* As the first paragraph of The Bidi Rules section explains, the rules need to be ignored if there are no Bidi labels present in the domain name. So, add `is_bidi_domain` evaluation to `processing()`, and pass it down to `passes_bidi()` to act on. * Add unit tests for the bidi rules, making it faster and easier to maintain the feature. * The new data file depends on the GC of `U+11C3A` to be `Mark`, but `is_combining_mark()` returns false on this character. Since the character has `GC=Mark` in Unicode 9.0, and the published version of `unicode-normalization` is also using Unicode 9.0 data, there must be a bug somewhere in the crate that needs to be fixed. To fix the problem locally until there's an upstream fix, I've added another check, on top of `is_combining_mark()`, using `Bidi_Class=NSM`, which covers two out of three `GC=Mark` subcategories. This local fix allow conformance tests to pass 100%.
1 parent 53b962a commit cfeb1a4

File tree

2 files changed

+219
-103
lines changed

2 files changed

+219
-103
lines changed

idna/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ rustc-serialize = "0.3"
2020

2121
[dependencies]
2222
unicode-bidi = "0.3"
23-
unicode-normalization = "0.1.3"
23+
unicode-normalization = "0.1"
2424
matches = "0.1"

0 commit comments

Comments
 (0)