*

1,获得InputStream

byte[] b =new byte[3];

instream.read(b);

instream.close();

if(b[0,1,2]==(-17,-69,-65)){

  则为UTF-8

}

b[0,1,2]==(34,32,73),则为 Big5

else

GBK,(其中断点测试一组为73,83,77)

*

相关文章:

  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-07-28
  • 2021-11-30
相关资源
相似解决方案