Today I used Tomcat to run a web project in Idea. After starting, the Tomcat logs were printed on the console in garbled code, as shown in the figure below:
This problem is caused by Tomcat's encoding problem. You can configure it as follows:
-Dfile.encoding=UTF-8
If it doesn't work, just like this:
Click OK. Restart TOMCAT for debugging, you can see that the Chinese in the tomcat log in the console can be displayed normally.
There shouldn't be any garbled codes above
If all the above attempts are still garbled, you need to modify the configuration file
Enter the installation directory of idea and enter the bin directory. Find the idea.exe.vmoptions file and idea64.exe.vmoptions.
Add -Dfile.encoding=UTF-8 on the last line, and it is best to add both files.
Summarize
The above is the solution to the IDEA garbled code on the Tomcat console introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!