Idea console Chinese garbled solution

One: modify the idea configuration

Find the following two configuration files in the bin directory of the idea installation
figure 1
and add the following content:

-Dfile.encoding=UTF-8

Then, restart idea to see if the problem is solved

2: Modify the default encoding of Idea workspace to UTF-8

Enter idea: click File -> Settings -> Editor -> File Encodings, and then set all the codes inside to UTF-8
figure 2

Three: Modify the Tomcat configuration in Idea to UTF-8

Click the configuration of tomcat in Idea:
Figure 4
then VM optionsadd the following content

-Dfile.encoding=UTF-8

Then, select Startup/Connection
Figure 5
and add the JAVA_TOOL_OPTIONSvalue as -Dfile.encoding=UTF-8content:

Figure 6
Generally, the console garbled code can be solved through the above steps, but if it still can't be solved, then look down.

Four: modify the configuration of Tomcat (the last helpless move)

Tomcat into the installation directory, locate the logging.propertiesfile
Figure 7
will be java.util.logging.ConsoleHandler.encodingchanged to GBK

java.util.logging.ConsoleHandler.encoding = GBK

The author solved the idea console garbled in this way.
If you still have questions? ? ?
If you use step 4, the tomcat log output is not garbled, but the console's own project output log is still garbled
Picture 8
, delete the content of the configuration in step 3 "Modify the Tomcat configuration in Idea to UTF-8", and then start the project, and find that it is normal Up
Picture 9

Guess you like

Origin blog.csdn.net/u011047968/article/details/108418085