首页 > 代码库 > [C#] GBK转UTF-8 编码

[C#] GBK转UTF-8 编码

  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;        }