GB2312 for Silverlight

Project Description
This class is for support GB2312 simplified Chinese characters for Silverlight(include Windows Phone 7) Application and inherited from Encoding abstract class. It's developed in CSharp.
这个类能够让 Silverlight(包含 Windows Phone 7)应用程序支持 GB2312 简体中文字符集,从 Encoding 抽象类继承。使用 C# 语言编写。
GB2312Encoding  is fully implemented all Encoding functions therefore you can uses it as easy as system built-in Encoding features. In order to use the  GB2312Encoding , you must embed an addition data file in your assembly.
Following features has been implemented:
  • Immediate decode array bytes and encode string or array chars
  • Simple use StreamReader and StreamWriter read and write stream

GB2312Encoding  类完整的实现了 Encoding 的所有功能,因此你可以很容易的实现所有的字符集编码功能。为了使用  GB2312Encoding ,你必须嵌入一个附加的数据文件到你的程序集。
本程序实现了下列功能:
  • 解码字节数组和编码字符串或字符数组
  • 使用 StreamReader 和 StreamWriter 对流进行读写操作

Sample(例子):

WebClient _wc = new WebClient();
_wc.Encoding = new GB2312.GB2312Encoding();
_wc.DownloadStringCompleted += (ss, ee) => txtResult.Text = ee.Result;
_wc.DownloadStringAsync(new Uri(txtUrl.Text));

How to use:

Copy  GB2312Encoding.cs  and  gb2312.bin  files into your project and  make sure :
  • gb2312.bin file’s build action is “Embedded Resource”
  • gb2312.bin filename correct(cannot modify filename)
  • GB2312Encoding.cs and gb2312.bin files in same folder

如何使用:

把  GB2312Encoding.cs  和  gb2312.bin  文件复制到你的项目并 确保
  • gb2312.bin 文件的生成操作是“嵌入的资源”
  • gb2312.bin 文件的文件名正确(不能修改此文件名)
  • GB2312Encoding.cs 和 gb2312.bin 文件在同一个文件夹
  • 下载地址:http://gb2312.codeplex.com/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值