UTF8编码转GBK编码。
using System.Text;
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); // 注册代码页
Encoding utf8 = Encoding.UTF8; // UTF-8
Encoding gbk = Encoding.GetEncoding("gbk"); // Encoding.Default ,936
byte[] utf8Bytes = utf8.GetBytes(utf8Text); // 将UTF-8字符串转为UTF-8 字节流
byte[] gbkBytes = Encoding.Convert(utf8, gbk, utf8Bytes);// 将UTF-8 字节流 转为 GBK字节流
string gbkText = gbk.GetString(gbkBytes); // 将GBK字节流转为GBK字符串