让Silverlight支持GB2312中文编码

      今天遇到一个问题,Silverlight的Encoding不支持gb2312的编码,为了让SL的gb2312受支持,今天在

http://htmlextractor.codeplex.com/中找到了Gb2312Encoding.cs以及Gb2312toUnicodeDictinary.cs两个文件,然后使用:

Gb2312Encoding encoding = new Gb2312Encoding();
string str1 = encoding.GetString(bytes, 0, bytes.Length);

即可获得中文的编码,为了大家使用方便,我这里提供两个类的下载链接:

GB2312相关的编码类.rar

posted @ 2011-03-08 01:37  Leepy  阅读(3754)  评论(11编辑  收藏  举报