乱码解决方案
注意:运行后打开页面要刷新,否则缓存会把乱码的页面打开。刷新(Ctrl + F5)
工具:idea 2018、tomcat
问题:打开静态文件(jsp、html)没有乱码问题,但是使用软件打开程序出现乱码。运行后白色字体没有乱码问题,但控制台报红中文的出现乱码。
我的解决方案
1、打开idea --> File --> Settings --> Build,Execution,Deployment --> java Compiler -->
2、 File --> Settings --> Editor --> File Encodings --> 右边框里全改为:UTF-8
3、修改tomcat配置
4、在桌面右键IDEA(idea的快捷方式) --> 打开文件所在位置 --> 修改 idea64.exe.vmoptions 和 idea.exe.vmoptions 文件在里面添加 一行 -Dfile.encoding=UTF-8
5、找到tomcat路径下的 D:Appacheapache-tomcat-8.0.47confserver.xml,加上URIEncoding="utf-8"