Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

String.Compare() giving incorrect result for case insensitive comparison in Ukranian?

$
0
0

The following code should print true, but it prints false. Can someone explain what's going on? This code works on about 100 other languages (including Turkish strings) but somehow fails on Ukranian. It actually even works for some strings in Ukranian, but not for the one in the sample code below.

(Server 2k8R2, VS2013, .Net 4.5)

string text = "конфіденційність";
CultureInfo ci = new CultureInfo("uk-UA");

string textUpper = text.ToUpper(ci);

Console.WriteLine(String.Format("Equal: {0}", String.Compare(text, textUpper, true, ci) == 0));


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>