CharsetPrinter解决windows和Linux读取文件乱码,使用代码如下: public static String guessEncoding(String filename) { try { CharsetPrinter charsetPrinter = new CharsetPrinter(); String encode = charsetPrinter.guessEncoding(new File(filename)); return e