解决ideal控制台乱码的问题-所有的都设置成UTF8了还是乱码?怎么调都不行可能不是idea的锅

一般性解决方式

  • idea/bin/idea.exe.vmoptions,idea/bin/idea64.exe.vmoptions 增加

-Dfile.encoding=UTF-8
-Dconsole.encoding=UTF-8

  • 检查idea中项目编码方式editor > file encoding是否utf-8

  • 在run/debug configure中的vm options添加

-Dfile.encoding=GBK

还不行?

分清楚是tomcat的控制台信息,还是你的输出日志信息乱码:

如果你尝试了其他人的帖子还没有解决问题,看看是否是如下图这样?

那就是tomcat的锅

再tomcat安装目录/config/logging.properties文件中添加(别把这个放到linux上去哦)

java.util.logging.ConsoleHandler.encoding = GBK

猜你喜欢

转载自blog.csdn.net/weixin_48470176/article/details/110942960