Article Directory
One: modify the idea configuration
Find the following two configuration files in the bin directory of the idea installation
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
Three: Modify the Tomcat configuration in Idea to UTF-8
Click the configuration of tomcat in Idea:
then VM options
add the following content
-Dfile.encoding=UTF-8
Then, select Startup/Connection
and add the JAVA_TOOL_OPTIONS
value as -Dfile.encoding=UTF-8
content:
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.properties
file
will be java.util.logging.ConsoleHandler.encoding
changed 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
, 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