捣鼓明白这是 UTF8中文 转 16进制
再给转回来就行了
找了个通用转换方法:
1 ///<summary> 2 /// 从16进制转换成汉字 3 /// </summary> 4 /// <param name="hex"></param> 5 /// <param name="charset">编码,如"utf-8","gb2312"</param> 6 /// <returns></returns> 7 public static string UnHex(string hex, string charset) 8 { 9 if (hex == null) 10 throw new ArgumentNullException("hex"); 11 hex = hex.Replace(",", ""); 12 hex = hex.Replace("\n", ""); 13 hex = hex.Replace("\\", ""); 14 hex = hex.Replace(" ", ""); 15 if (hex.Length % 2 != 0) 16 { 17 hex += "20";//空格 18 } 19 // 需要将 hex 转换成 byte 数组。 20 byte[] bytes = new byte[hex.Length / 2]; 21 for (int i = 0; i < bytes.Length; i++) 22 { 23 try 24 { 25 // 每两个字符是一个 byte。 26 bytes[i] = byte.Parse(hex.Substring(i * 2, 2), 27 System.Globalization.NumberStyles.HexNumber); 28 } 29 catch 30 { 31 // Rethrow an exception with custom message. 32 //throw new ArgumentException("hex is not a valid hex number!", "hex"); 33 return "hex is not a valid hex number!"; 34 } 35 } 36 System.Text.Encoding chs = System.Text.Encoding.GetEncoding(charset); 37 return chs.GetString(bytes); 38 }