5
我想從Windows Phone 7的字符串中刪除重音(變音符號)。 解決方案here適用於.NET(桌面版)。但是,WP7字符串沒有Normalize
方法。如何從WP7中的字符串中刪除重音
Someone suggest change from string to byte,但我不知道他的意思。如何刪除口音?
我想從Windows Phone 7的字符串中刪除重音(變音符號)。 解決方案here適用於.NET(桌面版)。但是,WP7字符串沒有Normalize
方法。如何從WP7中的字符串中刪除重音
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, 0, tempBytes.Length);
}
編輯:此解決方案可在Windows 8的應用程序,而不是Windows Phone中。到目前爲止,我已經找到了最好的解決方案是本手冊之一:
http://invokeit.wordpress.com/2011/10/06/how-to-remove-diatrics-accent-marks-in-windows-phone-7-x/
我已經看到它在CodeProject上,但在WP7我收到** ISO-8859-8' 是不支持的編碼名稱** – onmyway133
我必須接受來自鏈接的手動解決方案。 = [ 但它工作得很好。 –