本文实例讲述了C#简单判断字符编码的方法。分享给大家供大家参考,具体如下: public static string GetText(byte[] buff) { string strReslut = string.Empty; if (buff.Length > 3) { if (buff[0] == 239 && buff[1] == 187 && buff[2] == 191) {// utf-8 strReslut = Encoding.UTF8.GetString(buff); } else if (buff[0] == 25