Sun 7 Mar 2004
Those Tricky Georgians
Posted by dkaz under Java
Tricky Georgians change their language and get a mention in the java.lang
source code. Shameless.
<from String.equalsIgnoreCase(String)>
if (ignoreCase) {
// If characters don’t match but case may be ignored,
// try converting both characters to uppercase.
// If the results match, then the comparison scan should
// continue.
char u1 = Character.toUpperCase(c1);
char u2 = Character.toUpperCase(c2);
if (u1 == u2) {
continue;
}
// Unfortunately, conversion to uppercase does not work properly
// for the Georgian alphabet, which has strange rules about case
// conversion. So we need to make one last check before
// exiting.
if (Character.toLowerCase(u1) == Character.toLowerCase(u2)) {
continue;
}
}

March 7th, 2004 at 11:19 pm
that snippet doesn’t mention if converting to lowercase has any special cases to counter for, otherwise why don’t they just do the lowerCase in the first place?
btw, it’s from String::regionMatches(boolean ignoreCase, int toffset, String other, int ooffset, int len) [at least in 1.3.x]