爲解決intellij idea的控制檯亂碼,整整搞了一個半小時,簡直要吐血。希望此記錄能幫到大家,以及幫到未來的自己。。
1、將相關encoding設置爲UTF-8
2、修改tomcat配置,加上 -Dfile.encoding=UTF-8
3、設置tomcat的server.xml文件,添加 URIEncoding="UTF-8"
4、最關鍵一步,在IDEA中,點開 HELP->Edit Custom VM OPtions,添加 -Dfile.encoding=UTF-8,然後重啓,什麼亂碼都解決了。