C#将字符转换成utf8编码 GB321编码转换 public static string get_uft8(string unicodeString) { UTF8Encoding utf8 = new UTF8Encoding(); Byte[] encodedBytes = utf8.GetBytes(unicodeString); String decodedString = utf8.GetString(encodedBytes); return decodedString; } 这边我以big5转换gb2312为例 Encoding big5 =Encoding.GetEncoding("big5"); Encoding gb2312 = Encoding.GetEncoding("gb2312"); byte[] big5b= big5.GetBytes("編程無悔!"); //关键也就是这句了 byte[] gb2312b= Encoding.Convert(big5,gb2312,big5b); string strGb2312 = gb2312.GetString(gb2312b) 本文来源:https://www.wddqw.com/doc/946a8adccf84b9d529ea7a0c.html