ICU-2323 fix for ID 7 and linient compare of ID names ignoring _,- etc

X-SVN-Rev: 9988
This commit is contained in:
Ram Viswanadha 2002-10-08 17:37:50 +00:00
parent 3dcfc893c6
commit f8b05c5c2d
2 changed files with 15 additions and 3 deletions

View File

@ -313,4 +313,12 @@ public class TestUScript extends TestFmwk{
oldAbbrId = newAbbrId;
}
}
public void TestScriptNames(){
for(int i=0; i<UScript.CODE_LIMIT;i++){
String name = UScript.getName(i);
if(name.equals("") ){
errln("FAILED: getName for code : "+i);
}
}
}
}

View File

@ -95,6 +95,7 @@ public final class UScript {
new NameCodePair( "CANADIAN_ABORIGINAL", UCAS ),
new NameCodePair( "CHEROKEE", CHEROKEE ),
new NameCodePair( "COMMON", COMMON ),
new NameCodePair( "COPTIC", COPTIC ),
new NameCodePair( "CYRILLIC", CYRILLIC ),
new NameCodePair( "DESERET", DESERET ),
new NameCodePair( "DEVANAGARI", DEVANAGARI ),
@ -378,7 +379,8 @@ public final class UScript {
char[] name2 = s2.toCharArray();
int i=0;
int j=0;
int endIndex1 = name1.length-1;
int endIndex2 = name2.length-1;
for(;;) {
if((i>=name1.length)||(j>=name2.length)) {
return (name1.length - name2.length);
@ -401,7 +403,9 @@ public final class UScript {
return rc;
}
}
if(i==endIndex1 && j==endIndex2){
return 0;
}
++i;
++j;
}