I am reading the CLR VIA C#
by Jeffrey Richter. And while explaining string comparison, he notes that:
When the Compare method is not performing an ordinal comparison, it performs character expansions. A character expansion is when a character is expanded to multiple characters regardless of culture.
String s1 = "Strasse";
String s2 = "Straße";
Boolean eq;
CultureInfo ci = new CultureInfo("de-DE");
eq = String.Compare(s1, s2, true, ci) == 0; // returns true
For the above case, he notes:
...the German Eszet character ‘ß’ is always expanded to ‘ss. So in the code example, the call to Compare will always return 0 regardless of which culture I actually pass in to it.
I want to know from which source, the runtime takes that ß
is equal to ss
or how it calculates it?