Thanks Johannes, you set me on the right track. The code with which I got it to work looks as follows:
public string ConvertSuperscript(string value)
{
string stringFormKd = value.Normalize(NormalizationForm.FormKD);
StringBuilder stringBuilder = new StringBuilder();
foreach (char character in stringFormKd)
{
UnicodeCategory unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(character);
if (unicodeCategory != UnicodeCategory.NonSpacingMark)
{
stringBuilder.Append(character);
}
}
return stringBuilder.ToString().Normalize(NormalizationForm.FormKC);
}
I tried the canonical decomposition before, but it needed the compatibility decomposition to work properly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…