阅读背景:

判断文件编码格式源代码_weixin_34302798的博客

来源:互联网 

 public static String get_charset( File file ) { String charset = "GBK"; byte[] first3Bytes = new byte[3]; try { boolean; BufferedInputStream bis = new BufferedInputStream( new FileInputStream( file ) ); bis.mark( 0 ); int read = bis.read( first3Bytes, 0, 3 ); if ( read == -1 ) return charset; if ( first3Bytes[0] == (byte) 0xFF && first3Bytes[1] == (byte) 0xFE ) { chars  public



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: