Friday, I transformed the rules in tables into a set of
machine-readable expressions, added all the provisions in bidi, and
wrote code to implement and test them. I later added the protocol rules as well, so it does a complete test of U-Label except for the Punycode length. Comments welcome - especially more test cases!<br>
<br>Rules at:<br><a href="http://unicode.org/cldr/data/tools/java/org/unicode/cldr/draft/idnaContextRules.txt" target="_blank">http://unicode.org/cldr/data/tools/java/org/unicode/cldr/draft/idnaContextRules.txt</a><br>(caveats: I focussed on the hard ones - there are also a number that I don&#39;t think belong, and didn&#39;t do them initially)<br>
<br>Log of running the test at:<br><a href="http://unicode.org/cldr/data/tools/java/org/unicode/cldr/draft/idnaTestLog.txt">http://unicode.org/cldr/data/tools/java/org/unicode/cldr/draft/idnaTestLog.txt</a><br>(in verbose mode, shows parse of the rules, and results of the test.)<br>

<br>Test cases at:<br>
<a href="http://unicode.org/cldr/data/tools/java/org/unicode/cldr/draft/idnaTestCases.txt" target="_blank">http://unicode.org/cldr/data/tools/java/org/unicode/cldr/draft/idnaTestCases.txt</a><br>
(I tried to get a couple of invalid and a couple of valid, for each character. Needs huge expansion, along the lines of <a href="http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt" target="_blank">http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt</a>)<br>

<font color="#888888">
</font><br clear="all">Code at:<br><a href="http://unicode.org/cldr/data/tools/java/org/unicode/cldr/draft/IdnaLabelTester.java" target="_blank">http://unicode.org/cldr/data/tools/java/org/unicode/cldr/draft/IdnaLabelTester.java</a><br>
(caveats; just wrote it out simply, no documentation; test code is just in the main() method. Note that when a label is disallowed, the test returns the first character that causes that, plus the rule responsible.)<br>
<br>Mark<br>