ICU-3594 fix USE_STD3_ASCII_RULES

X-SVN-Rev: 14879
This commit is contained in:
Ram Viswanadha 2004-04-06 02:34:10 +00:00
parent 623c46d430
commit a145d66a17
2 changed files with 9 additions and 11 deletions

View file

@ -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);
}
}

View file

@ -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();
}
}