使用下面语句查看编码:String encoding = System.getProperty("file.encoding");结果输出:ANSI_X3.4-1968,从而导致中文乱码。解决方法:通过 locale 查