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

我想在 Windows Phone 7中删除字符串中的重音符号(变音符号). 解决方案 here适用于.NET(桌面版).但是,WP7字符串没有Normalize方法. Someone suggest change from string to byte,但我不知道他的意思.如何去除口音? 我用这个: public static string RemoveAc

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

作者: dawei

【声明】:永州站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部