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)