skip the BOM of UTF-8

方法一:BufferedReader bufferedReader =new BufferedReader(new UnicodeReader(new FileInputStream(file)));
方法二:BufferedReader bufferedReader =new BufferedReader(new InputStreamReader(new BOMInputStream(new FileInputStream(file))));

 

以上两种方法均可解决以下字符问题:

  java.nio.charset.MalformedInputException: Input length = 1

posted @ 2018-04-18 15:51  samcheng  阅读(147)  评论(0编辑  收藏  举报