IdnMapping GetUnicode conformance tests fail
authorEric Erhardt <eric.erhardt@microsoft.com>
Wed, 13 Jan 2016 17:05:11 +0000 (11:05 -0600)
committerEric Erhardt <eric.erhardt@microsoft.com>
Wed, 13 Jan 2016 17:06:23 +0000 (11:06 -0600)
The IdnaConformanceTests fail on Unix because \u00DF, \u200C and \u200D characters are not being handled as specified in the http://www.unicode.org/Public/idna/6.0.0/IdnaTest.txt file.

The fix is to use UIDNA_NONTRANSITIONAL_TO_UNICODE and UIDNA_CHECK_CONTEXTJ options when calling uidna_openUTS46.

Partial fix for https://github.com/dotnet/corefx/issues/3406.

src/corefx/System.Globalization.Native/idna.cpp

index 024c02a6c8c936d414b75549af5b4e39b001f8c5..6101296f427a22b970c440252a3afe1b8b87102a 100644 (file)
@@ -12,7 +12,8 @@ const uint32_t UseStd3AsciiRules = 0x2;
 
 uint32_t GetOptions(uint32_t flags)
 {
-    uint32_t options = UIDNA_DEFAULT;
+    // Using Nontransitional to Unicode and Check ContextJ to match the current behavior of .NET on Windows
+    uint32_t options = UIDNA_NONTRANSITIONAL_TO_UNICODE | UIDNA_CHECK_CONTEXTJ;
 
     if ((flags & AllowUnassigned) == AllowUnassigned)
     {