]> granicus.if.org Git - icu/commitdiff
ICU-10639 detect the empty label before the ASCII dot in a domain name that contains...
authorMarkus Scherer <markus.icu@gmail.com>
Tue, 4 Mar 2014 19:44:46 +0000 (19:44 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Tue, 4 Mar 2014 19:44:46 +0000 (19:44 +0000)
X-SVN-Rev: 35331

icu4j/main/classes/core/src/com/ibm/icu/impl/UTS46.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/UTS46Test.java

index 610995518760a448ac4c85a18e9fd44df49b3c95..56724000c56a159ebf280759bf1ff51e67ec0936 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-* Copyright (C) 2010-2011, International Business Machines
+* Copyright (C) 2010-2014, International Business Machines
 * Corporation and others.  All Rights Reserved.
 *******************************************************************************
 */
@@ -177,8 +177,7 @@ public final class UTS46 extends IDNA {
                         break;
                     }
                     if(toASCII) {
-                        // Permit an empty label at the end but not elsewhere.
-                        if(i==labelStart && i<(srcLength-1)) {
+                        if(i==labelStart) {
                             addLabelError(info, Error.EMPTY_LABEL);
                         } else if((i-labelStart)>63) {
                             addLabelError(info, Error.LABEL_TOO_LONG);
index 146aba429f288c3f014f1c89ecffb18b60a5e06a..6830080983376927e7619592cb1b5797ceec39f3 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-* Copyright (C) 2010-2011, International Business Machines
+* Copyright (C) 2010-2014, International Business Machines
 * Corporation and others.  All Rights Reserved.
 *******************************************************************************
 */
@@ -360,6 +360,8 @@ public class UTS46Test extends TestFmwk {
           "1234567890123456789012345678901234567890123456789012345678901",
           "UIDNA_ERROR_LABEL_TOO_LONG|UIDNA_ERROR_DOMAIN_NAME_TOO_LONG" },
         // hyphen errors and empty-label errors
+        { ".", "B", ".", "UIDNA_ERROR_EMPTY_LABEL" },
+        { "\uFF0E", "B", ".", "UIDNA_ERROR_EMPTY_LABEL" },
         // "xn---q----jra"=="-q--a-umlaut-"
         { "a.b..-q--a-.e", "B", "a.b..-q--a-.e",
           "UIDNA_ERROR_EMPTY_LABEL|UIDNA_ERROR_LEADING_HYPHEN|UIDNA_ERROR_TRAILING_HYPHEN|"+