Garbled example
As shown in the picture:
my solution
In "Help" - "Edit Custom VM Options", add the code to the last line:
-Dfile.encoding=UTF-8
Then restart IDEA.
Other solution 1: Modify idea64.exe.vmoptions in the IDEA installation directory
Right-click IDEA shortcut -> Properties -> Open all locations of the file, find the idea64.exe.vmoptions file under the installation location of idea, and add the last line:
-Dfile.encoding=UTF-8
Other solution two: set IDEA encoding format
Open file->setting->editor->file encoding in turn, and the positions shown in the figure below are all selected as UTF-8:
Other solution three: configure tomcat to run encoding
In Server > VM options set to -Dfile.encoding=UTF-8, restart tomcat
Other Solution 4: Modify the console default encoding
Open File -> setting -> editor -> General -> Console in turn, and select UTF-8 for the position shown in the figure below