System.out.println使用出现乱码
List<String> stopWords;
try {
stopWords = FileUtils.readLines(new File(STOP_WORD_PATH));
} catch (IOException e) {
throw new RuntimeException(e);
}
System.out.println(stopWords);
哥们想看看哥们的东西进去没,所以println出来看看,结果打印出来一堆乱码。
看到这篇文章,灵感迸发,哥们是从txt导出来的,迅速查看txt的编码,🆗,找到罪魁祸首,当时的格式是ASNI,另存为保存为UTF-8格式之后成功打印。