File was loaded in the wrong encoding: 'UTF-8

File was loaded in the wrong encoding: 'UTF-8’
File was loaded in the wrong encoding: 'UTF-8_第1张图片原因:文件出现乱码并且提示File was loaded in the wrong encoding:‘UTF-8’。因为我们文件使用utf-8编译,但是windows默认使用GBK所以乱码。
解决办法:
一、点击右上角的Reload in another encoding,选择GBK(治标不治本)
在这里插入图片描述File was loaded in the wrong encoding: 'UTF-8_第2张图片
二、根本解决:
用Notepad++ 打开文件 > 编码 > 以UTF-8格式编码,然后回IDEA,重新 mvn clean install

你可能感兴趣的:(乱码)