I have the following code:
string firstMicro = "aa \u00b5 bb";
string secondMicro = "aa \u03bc bb";
Assert.IsFalse(firstMicro == secondMicro);
string upperFirstMicro = firstMicro.ToUpper();
string upperSecondMicro = secondMicro.ToUpper();
Assert.IsFalse(upperFirstMicro == upperSecondMicro);
In my case, the first test passes (obviously, both strings are different), but in second case, the test fails because both texts are identical ($AA M BB). I admit that in one of the cases I should have used CultureInfo – but at least in the first case (the micro sign from ASCII code) should have stayed the same … Can someone help me understand why is this happening?
Aparently, there is another thread here – How to correctly uppercase Greek words in .NET?, but there is no obvious answer …
Thanks.
D.
Some lowercase letters have the same uppercase equivalent. Sorry, but that’s how Unicode is defined.
For example, as you can see in the official UnicodeData.txt, both
U+0069 (i)andU+0131 (ı)haveU+0049 (I)for uppercase.What is the exact problem you’re having? Maybe we can help.