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

        }

  

你可能感兴趣的:(utf-8)