A German licensee has reported problems with our handling of the small sharp s (\u00DF) in our String class. In particular the equalsIgnoreCase method doesn't handle this character.
Here is an example to duplicate the problem :-
class test {
public static void main(String[] args) {
String string1 = "abc\u00DF";
String string2 = string1.toUpperCase();
if (string1.equalsIgnoreCase(string2))
System.out.println("equalsIgnoreCase says they are equal");
if (string1.toUpperCase().equals(string2.toUpperCase()))
System.out.println("equals says they are equal");
}
}
The issue is that toUpperCase converts \00DF to SS but this is not taken into account by the internal regionMatches method.
- relates to
-
JDK-4074852 String.toUpperCase might return a bigger String
- Closed