diff --git a/icu4j/src/com/ibm/icu/dev/test/stringprep/TestIDNA.java b/icu4j/src/com/ibm/icu/dev/test/stringprep/TestIDNA.java index ef695941a72..4473decac94 100644 --- a/icu4j/src/com/ibm/icu/dev/test/stringprep/TestIDNA.java +++ b/icu4j/src/com/ibm/icu/dev/test/stringprep/TestIDNA.java @@ -31,8 +31,8 @@ public class TestIDNA extends TestFmwk { // test StringBuffer toUnicode doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.DEFAULT, null); doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.ALLOW_UNASSIGNED, null); - //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.USE_STD3_RULES, null); - //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.USE_STD3_RULES|IDNA.ALLOW_UNASSIGNED, null); + doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.USE_STD3_RULES, null); + doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.USE_STD3_RULES|IDNA.ALLOW_UNASSIGNED, null); } } @@ -42,8 +42,8 @@ public class TestIDNA extends TestFmwk { // test StringBuffer toUnicode doTestToASCII(new String(TestData.unicodeIn[i]),TestData.asciiIn[i],IDNA.DEFAULT, null); doTestToASCII(new String(TestData.unicodeIn[i]),TestData.asciiIn[i],IDNA.ALLOW_UNASSIGNED, null); - //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.USE_STD3_RULES, null); - //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.USE_STD3_RULES|IDNA.ALLOW_UNASSIGNED, null); + doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.USE_STD3_RULES, null); + doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNA.USE_STD3_RULES|IDNA.ALLOW_UNASSIGNED, null); } } diff --git a/icu4j/src/com/ibm/icu/text/IDNA.java b/icu4j/src/com/ibm/icu/text/IDNA.java index b636b89606a..0332604b596 100644 --- a/icu4j/src/com/ibm/icu/text/IDNA.java +++ b/icu4j/src/com/ibm/icu/text/IDNA.java @@ -318,11 +318,10 @@ public final class IDNA { char ch=processOut.charAt(j); if(ch > 0x7F){ srcIsASCII = false; - } - // here we do not assemble surrogates - // since we know that LDH code points - // are in the ASCII range only - if(isLDHChar(ch)==false){ + }else if(isLDHChar(ch)==false){ + // here we do not assemble surrogates + // since we know that LDH code points + // are in the ASCII range only srcIsLDH = false; failPos = j; } @@ -614,8 +613,7 @@ public final class IDNA { while((ch=src.next())!= UCharacterIterator.DONE){ if(ch>0x7F){ srcIsASCII = false; - } - if((srcIsLDH = isLDHChar(ch))==false){ + }else if((srcIsLDH = isLDHChar(ch))==false){ failPos = src.getIndex(); } }