在 Windows Phone 8 中读取 Windows-1252 编码 [英] Reading Windows-1252 encoding in Windows Phone 8
问题描述
在 Windows 中,我可以通过 .NET 使用 Encoding.GetEncoding(Windows-1252")来检索Windows-1252"代码页编码.不幸的是,此调用在 Windows Phone 8 模拟器中引发 ArgumentExtception,指定编码名称无效.我环顾了 MSDN,但没有找到任何有用的东西.有谁知道 Windows Phone 8 中可用的编码以及Windows-1252"编码的新名称是什么?
In Windows, I can use the Encoding.GetEncoding ("Windows-1252") via .NET to retrieve the "Windows-1252" code page encoding. Unfortunately, this call throws an ArgumentExtception in Windows Phone 8 emulator, specifying that the encoding name is not valid. I looked around MSDN but didn't find anything useful. Does anyone know about which encodings are available in Windows Phone 8 and which is the new name of the "Windows-1252" encoding?
是的,我知道使用iso-8859-1"编码并手动替换 129-159 范围内的字符的替代选项.但如果可能的话,我会尽量避免这种情况.
And yes, I am aware of the alternative option of using the "iso-8859-1" encoding and manually substituting the characters in the 129-159-range. But I'm trying to avoid that if possible.
非常感谢,迈克尔
推荐答案
我不确定这是否仍然有效,但记住它很有用.此工具生成单字节代码页的源代码
I am not sure this still works but remember it was useful. This tools generates the source code for a single byte code pages
http://www.hardcodet.net/2010/03/silverlight-text-encoding-class-generator
我希望生成的源代码适用于基类库的 windows phone 子集.
I hope the generated source works in windows phone subset of the base class library.
这篇关于在 Windows Phone 8 中读取 Windows-1252 编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!