求解:GB2312转换繁体BIG5乱码
string C_Name = row["C_Name"].ToString();Encoding gb2312 = Encoding.GetEncoding("gb2312");
Encoding big5 = Encoding.GetEncoding("big5");
byte[] srcByte = gb2312.GetBytes(C_Name);
byte[] dstByte = Encoding.Convert(gb2312, big5, srcByte);
char[] dstChars = new char[big5.GetCharCount(dstByte, 0, dstByte.Length)];
big5.GetChars(dstByte, 0, dstByte.Length, dstChars, 0);
newRow["EmpName"] = new string(dstChars); --------------------编程问答-------------------- 但是转化为UTF8或Unicode则不会乱码 --------------------编程问答-------------------- 以上代碼是把數據從簡體sqlserver數據庫導入到繁體sqlserver數據庫,但是出現亂碼,不知何解,請教各位大蝦。
补充:.NET技术 , C#