(Solved) Chinese garbled characters in IDEA Tomcat console

content

foreword

This blog records how to solve the problem of garbled output of the tomcat console in the win system idea configuration. I will list all the attempts. Friends who have the same problem can learn from it. My own solution is method 6. It is recommended to try it first.

environment

System: windows 7
IDEA: 2020.1
Tomcat: 7.0.96

Problem Description:

After IDEA configures Tomcat, start the output in the IDEA console, the Chinese is garbled
garbled

try

1. Configure startup parameters (unresolved)

-Dfile.encoding=UTF-8

insert image description here

2. Modify IDEA configuration , idea64.exe.vmoptions (unresolved)

安装目录JetBrainsIntelliJ IDEA 2019.2.2inidea64.exe.vmoptionswith 安装目录JetBrainsIntelliJ IDEA 2019.2.2inidea.exe.vmoptionsadding a line

-Dfile.encoding=UTF-8

insert image description here

Also configure method 1

3. Modify Tomcat configuration (unresolved)

Tomcat installation directory ...apache-tomcat-8.5.57conflogging.properties, change all UTF-8 to GBK, save and restart

4. Configure IDEA FileEncoding (unresolved)

From File->Setting, set File Encodings, check if Default Encodings is UTF-8
insert image description here

5. Configure JAVA_TOOL_OPTION (unresolved)

Name: JAVA_TOOL_OPTION
Value: -Dfile.encoding=UTF-8
Methods 1, 2, 4 are also configured
insert image description here

6. Modify VmOption by setting ( solve )

This is different from method 2, this is to modify the parameters through the method provided by the program, the final test is valid
Help->Edit Custom VM Options..., add a line-Dfile.encoding=UTF-8

I have also configured method 4 here, because I think the unified encoding format is good, so I did not restore the configuration. If configuring method 6 alone does not take effect, you can try configuring method 4

insert image description here

Summarize

First attach the solution renderings (cry with joy)
insert image description here

Through the last successful method analysis, the modified configuration file is actually the configuration file in the AppData directory
insert image description here

おすすめ

転載: blog.csdn.net/m0_54850604/article/details/123717997