idea server console garbled code

1. The console log information is garbled.

1.1Problem description

Garbled characters
Insert image description here

normal circumstances
Insert image description here

1.2 Solution

Find logging.properties in the conf directory of tomcat used, as shown below
Insert image description here

Find java.util.logging.ConsoleHandler.encoding in logging.properties
java.util.logging.ConsoleHandler.encoding =GBK and change it to UTF-8
Insert image description here

2. The statements (Chinese) entered in the code are garbled on the console

details as following
Insert image description here

2.1 Solution

Step 1 Click Edit Configurations to open the Run/Debug Configurations window;

Insert image description here

The second step is to modify the Vm Options parameter VM options to: -Dfile.encoding=UTF-8

Insert image description here

Finally click apply

Restart tomcat

Guess you like

Origin blog.csdn.net/wyr1235/article/details/128799693