目前的数据是 gb2312 的byte[] 求 一次性将 数据转换为 utf-8 的string 代码 ,谢谢
Encoding gb2312Encoding = new Encoding(936); // GB2132 encoding
Encoding utf8Encoding = new Encoding.UTF8; // utf8 encoding
byte[] bytes = Encoding.Convert(gb2312Encoding, utf8Encoding, src); // convert source bytes
string str = utf8Encoding.GetString(bytes); // get string from bytes
Encoding utf8Encoding = new Encoding.UTF8; // utf8 encoding
byte[] bytes = Encoding.Convert(gb2312Encoding, utf8Encoding, src); // convert source bytes
string str = utf8Encoding.GetString(bytes); // get string from bytes
温馨提示:答案为网友推荐,仅供参考