一次解決所有亂碼問題,專治各種水土不服
1. 首先修改Tomcat
找到你tomcat的conf目錄下的logging.properties
- 如圖把 1和2的 encoding 註釋掉
- 如圖把 3和4的encoding 改成 utf-8
- 如圖把logging的 編碼改成 utf-8
2. 修改 idea
- 打開File —> Settings --> Editer --> File Encodings 把能看到的跟編碼相關的 都改成 UTF- 8 然後點 OK
- 打開 Help —> Edit Custom VM Options 在最後一行添加 -Dfile.encoding=UTF-8
- 如圖點擊Edit Configurationgs…
- 找到server 頁籤 的VM Options項 添加 -Dfile.encoding=UTF-8
3 . 重啓 IDEA 開啓服務 一切都解決了
- server
- Tomcat Localhost Log
- Tomcat Catalina Log