如何在WP7中从字符串中删除重音

前端之家收集整理的这篇文章主要介绍了如何在WP7中从字符串中删除重音前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想在 Windows Phone 7中删除字符串中的重音符号(变音符号).
解决方here适用于.NET(桌面版).但是,WP7字符串没有Normalize方法.

Someone suggest change from string to byte,但我不知道他的意思.如何去除口音?

我用这个:
public static string RemoveAccents(this string accentedStr)
{
    byte[] tempBytes = Encoding.GetEncoding("ISO-8859-8").GetBytes(accentedStr);
    return Encoding.UTF8.GetString(tempBytes,tempBytes.Length);
}

编辑:此解决方案适用于Windows 8应用程序,但不适用于Windows Phone.到目前为止我找到的最佳解决方案是本手册:
http://invokeit.wordpress.com/2011/10/06/how-to-remove-diatrics-accent-marks-in-windows-phone-7-x/

猜你在找的Windows相关文章