开发者

How can I take a look at the Unicode normalization algorithm in .Net/C# with Mono?

Dear all, how do I get to peek at the source code for any of the alg开发者_如何学Corithms of .NET? In particular, I'd like to take a look at the unicode normalization algorithm... I'm using Mono in Ubuntu.


From the Mono website:

The Mono source code is hosted on GitHub using the Git source code control system for all of its source code.

[...]

If all you need is to browse the sources, you can go to Mono Organization page on GitHub.

The String Class is in the mscorlib assembly. You can find it in /mcs/class/corlib/System/String.cs.

String.Normalize looks like this:

public string Normalize ()
{
    return Normalization.Normalize (this, 0);
}

public string Normalize (NormalizationForm normalizationForm)
{
    switch (normalizationForm) {
    default:
        return Normalization.Normalize (this, 0);
    case NormalizationForm.FormD:
        return Normalization.Normalize (this, 1);
    case NormalizationForm.FormKC:
        return Normalization.Normalize (this, 2);
    case NormalizationForm.FormKD:
        return Normalization.Normalize (this, 3);
    }
}

The internal Normalization class is in /mcs/class/corlib/Mono.Globalization.Unicode/Normalization.cs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜