Consider this comparison:
String a = "\u00C4"; // "LATIN CAPITAL LETTER A WITH DIAERESIS"
String b = "\u0041\u0308"; // "LATIN CAPITAL LETTER A" and "COMBINING DIAERESIS"
Comparing them in Danish C # culture, returns false:
Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK", false);
Console.WriteLine(a.Equals(b, StringComparison.CurrentCulture)); // false
Comparing them in Java Danish, returns true:
System.out.println(Collator.getInstance(new Locale("Danish (Denmark)").equals(a,b));
I listed all the locales / cultures in both environments and confirmed that the correct ones were selected. Am I missing something? What's the difference?
source
share