[Mono-devel-list] Patch idea for previous message

Atsushi Eno atsushi at ximian.com
Tue Jun 7 04:10:49 EDT 2005


Hi,

> Any method that is culture-sensitive can take CultureInfo.InvariantCulture
> as a formatter, comparer, ..., at this will make it culture-insensitive as
> InvariantCulture should have the same characterisitcs across all versions
> and even in different runtimes.
> 
> Use string.Compare(s1,s2,true,CultureInfo.InvariantCulture) for example.

No, you aren't aware of the whole problem. String comparison with
invariant culture does not mean that it has no other side effect
than case insensitivity. With CultureInfo dependent (including
InvariantCulture) there are some characters that are ignored in the
comparison (and sometimes culture-sensitive comparison is buggy, at
least with MS.NET) or regarded equivalent to other character
sequences.

Try

	Console.WriteLine (String.Compare ("\u00C6", "AE",
		true, CultureInfo.InvariantCulture));

under MS.NET.

Atsushi Eno



More information about the Mono-devel-list mailing list