public static string CleanSortKey(string defaultsort)
{
// no diacritic removal in sortkeys on wikis using uca- / Unicode sorting (e.g. fr/pl/ru wiki)
if (!Variables.UnicodeCategoryCollation)
defaultsort = RemoveDiacritics(defaultsort);
defaultsort = defaultsort.Replace("–", "–");
defaultsort = defaultsort.Replace("—", "—");
// normalisation - simplify double spaces to a single one
while(defaultsort.Contains(" "))
defaultsort = defaultsort.Replace(" ", " ");
foreach (var p in SortKeyChars)
{
defaultsort = defaultsort.Replace(p[0], p[1]);
}
return defaultsort;
}