.NET的String.Normalize做什么? [英] What does .NET's String.Normalize do?

查看:74
本文介绍了.NET的String.Normalize做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关String.Normalize的MSDN文章指出简单地:


返回一个新的字符串,其二进制表示形式采用特定的Unicode规范化形式。

Returns a new string whose binary representation is in a particular Unicode normalization form.

有时也指 Unicode规范化形式C。

And sometimes referring to a "Unicode normalization form C."

我只是想知道,这是什么意思?此函数在现实生活中如何有用?

I'm just wondering, what does that mean? How is this function useful in real life situations?

推荐答案

它确保unicode字符串可以比较相等性(即使它们被比较)使用不同的unicode编码。)

It makes sure that unicode strings can be compared for equality (even if they are using different unicode encodings).

来自Unicode标准附件#15

From Unicode Standard Annex #15:


本质上,Unicode规范化算法将所有组合标记按指定顺序放置,并使用规则分解和合成,将每个字符串转换为Unicode规范化形式之一。转换后的字符串的二进制比较将确定等效性。

Essentially, the Unicode Normalization Algorithm puts all combining marks in a specified order, and uses rules for decomposition and composition to transform each string into one of the Unicode Normalization Forms. A binary comparison of the transformed strings will then determine equivalence.

这篇关于.NET的String.Normalize做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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