What does .NET's String.Normalize do?

后端 未结 4 422
被撕碎了的回忆
被撕碎了的回忆 2020-12-01 07:01

The MSDN article on String.Normalize states simply:

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

4条回答
  •  佛祖请我去吃肉
    2020-12-01 07:52

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

    From Unicode Standard Annex #15:

    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.

提交回复
热议问题