Test to see if phone book sorting is supported for German

In regular German sorting, letters with umlauts are sorted the same as the equivalent letter without umlaut. As letters without umlauts can be alternately expanded to the base letter followed by an "e": ä -> ae, ö -> oe, and ü -> ue, and names can often be spelt both ways, phonebooks treat an umlauted character the same as if it was expanded. Thus "Häßler" (Haessler) comes before Hamman; and "Müller" and "Mueller" are interchangeable so are sorted by first name.

JavaScript

var str = ["Mueller, Peter", "Hamann, Dietmar", "Müller, Gerd", "Müller, Thomas", "Häßler, Thomas"],
    locales = ["de", "de-u-co-phonebk"],
    length = locales.length,
    sorter = null;

console.clear();

for (var i = 0; i < length; i++) { 
    sorter = new Intl.Collator(locales[i], { usage: "sort" });
    console.log(sorter.resolvedOptions().locale)
    console.log(str.sort(sorter.compare));
}