3

Is there any alternative to string.Normalize() in WinRT? I want to simply remove accents from input strings using this approach, but I cannot find anywhere this method in WinRT.

Community
  • 1
  • 1
Martin Suchan
  • 10,600
  • 3
  • 36
  • 66

2 Answers2

5

I've discovered here quick and short solution, that works just fine in WinRT:

public static string RemoveAccents(this string accentedStr)
{
    byte[] tempBytes = Encoding.GetEncoding("ISO-8859-8").GetBytes(accentedStr);
    return Encoding.UTF8.GetString(tempBytes, 0, tempBytes.Length);
}
Community
  • 1
  • 1
Martin Suchan
  • 10,600
  • 3
  • 36
  • 66
0

You will not find any alternative to String.Normalize in WinRT because it is available as part of the .NET Core Profile that is available to Metro style apps. Docs. If you are using C++, see this question.

Community
  • 1
  • 1
JP Alioto
  • 44,864
  • 6
  • 88
  • 112