我想在
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/