开发者

Encoding.GetEncoding("CP437") in Windows Phone 7

I am quite new in Silverlight 4 and Windows Phone 7 Development...

My Requirement:

  // It Gives error: 'CP437' is not a supported encoding name.   
  // (The same line works fine in C#.Net Console Application)  

  Encoding enc = Encoding.GetEncoding("CP437");  
  byte[] ByteArray = { 65, 127, 171, 174, 175, 171, 66, 0 };  
  char[] CharArray = enc.GetChars(ByteArray);

Any pointer on how to implement En开发者_JAVA技巧coding.GetEncoding("CP437") in Windows Phone 7 (C#.Net 4.0)


As I recall, code page 437 is the original IBM PC character set. This is not available on Windows Phone and as far as I know it never will be. As you can see here A½«»B most of your sample characters are available from unicode requiring only a translation table, but some like the DEL character and the IBM line drawing characters (not in your sample but present in code page 437) would require specialised character sets such as Terminal (which is an ancient bitmap font).

Perhaps if you gave more information about your purpose?


You can generate the custom Encoding class for Silverlight from Desktop .NET by writing your code or by using some code generator.

Check out this link for an detailed info and tool to do just that:

http://www.hardcodet.net/2010/03/silverlight-text-encoding-class-generator/comment-page-1#comment-14440

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜