Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there String.Normalize() alternative in WinRT?

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.

like image 207
Martin Suchan Avatar asked Jul 13 '26 23:07

Martin Suchan


1 Answers

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);
}
like image 68
Martin Suchan Avatar answered Jul 20 '26 14:07

Martin Suchan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!