Solution to console garbled characters in IDEA

1. Set the 3 positions to UTF-8 in the "File Encoding" in the settings. Note: The setting here has nothing to do with the console garbled characters. The 3 positions can all be set to UTF-8 or the system default value.

insert image description here

2. In Tomcat's "Edit Configuration", set VM options to -Dfile.encoding=GBK (similar to the third step, the default is GBK).

insert image description here

3. Do not change any content in the idea64.exe.vmoptions file and idea.exe.vmoptions file in the IDEA installation directory, using the default code means GBK.

4. The most critical: In the path of Tomcat, set the java.util.logging.ConsoleHandler.encoding in the \conf\logging.properties file to GBK, and the rest of the file is originally set for UTF-8. Keep the UTF-8 setting, don't change it.

insert image description here

Guess you like

Origin blog.csdn.net/qq_42373007/article/details/131187860