Java 自动检测文本文件编码 private String guessCharset(InputStream is) throws IOException { return new TikaEncodingDetector().guessEncoding(is);}