日期:2014-05-17 浏览次数:20457 次
string gb2312info = "测试!";
string utfinfo = string.Empty;
Encoding utf8 = Encoding.UTF8;
Encoding gb2312 = Encoding.GetEncoding("gb2312");
// Convert the string into a byte[].
byte[] unicodeBytes = gb2312 .GetBytes(gb2312info );
// Perform the conversion from one encoding to the other.
byte[] asciiBytes = Encoding.Convert(gb2312,utf8, unicodeBytes);