tags:

views:

42

answers:

1

Dear all, how do I get to peek at the source code for any of the algorithms of .NET? In particular, I'd like to take a look at the unicode normalization algorithm... I'm using Mono in Ubuntu.

+4  A: 

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.

dtb