.net micro (µ) 希腊字母大写问题 [英] .net micro (µ) greek letter uppercase issue

查看:46
本文介绍了.net micro (µ) 希腊字母大写问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码:

 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);

在我的例子中,第一个测试通过(显然,两个字符串不同),但在第二个例子中,测试失败,因为两个文本是相同的 ($AA M BB).我承认在其中一种情况下我应该使用 CultureInfo - 但至少在第一种情况下(来自 ASCII 代码的微符号)应该保持不变......有人可以帮助我理解为什么会发生这种情况吗?

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?

显然,这里还有另一个主题 - 如何正确大写希腊语.NET 中的话?,但没有明显的答案......

Aparently, there is another thread here - How to correctly uppercase Greek words in .NET?, but there is no obvious answer ...

谢谢.D.

推荐答案

某些小写字母具有相同的大写字母.抱歉,Unicode 就是这样定义的.

Some lowercase letters have the same uppercase equivalent. Sorry, but that's how Unicode is defined.

例如,正如您在官方 UnicodeData.txt 中所见,U+0069 (i)U+0131 (ı) 都有 U+0049 (I) 表示大写.

For example, as you can see in the official UnicodeData.txt, both U+0069 (i) and U+0131 (ı) have U+0049 (I) for uppercase.

您遇到的确切问题是什么?也许我们可以提供帮助.

What is the exact problem you're having? Maybe we can help.

这篇关于.net micro (µ) 希腊字母大写问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆