Why does string.Compare seem to handle accented characters inconsistently?
I have the following code
var s1 = "ABzzzzz2"; var s2 = "äbzzzzz1"; var cmp = StringComparison.InvariantCultureIgnoreCase; Console.WriteLine(string.Compare(s1, 0, s2, 0, 7, cmp)); //prints -1 Console.WriteLine(string.Compare(s1, 0, s2, 0, 8, cmp)); //prints 1
How could it be that part of the first string is less than part of the second, while the whole first string is greater than the whole second one?
I've tested it on x64, .net 2.0, 3.5, 4.0