码迷,mamicode.com
首页 > 其他好文 > 详细

[C#] GBK转UTF-8 编码

时间:2014-08-16 11:00:50      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:blog   ar   div   html   log   new   htm   har   

  private string Gbk2Utf8(string input)
        {
            if (string.IsNullOrEmpty(input))
            {
                return "";
            }
            Encoding encoding = System.Text.Encoding.GetEncoding("GB2312");
            byte[] bytes = encoding.GetBytes(input);
            encoding = System.Text.Encoding.UTF8;
            string newOldHtml = encoding.GetString(bytes);
            return newOldHtml;
        }

  

[C#] GBK转UTF-8 编码,布布扣,bubuko.com

[C#] GBK转UTF-8 编码

标签:blog   ar   div   html   log   new   htm   har   

原文地址:http://www.cnblogs.com/zfanlong1314/p/3916081.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!