Resolve Tomcat garbled characters

Method one:

Modify Tomcat conf server. XML file with URIEncoding=” utF-8″To open add

    <Connector port="8080" protocol="HTTP / 1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               URIEncoding="UTF-8"/>
Copy the code


Method 2:

Add the following Settings in the catalina.bat configuration file in the bin directory of Tomcat

set "JAVA_OPTS=%JAVA_OPTS% %JSSE_OPTS% -Dfile.encoding=UTF-8" 
Copy the code


Method 3:

Modify the logging.properties file in the conf folder of the Tomcat installation directory:

Find the Java. Util. Logging. ConsoleHandler. Encoding = utf-8

Instead of Java. Util. Logging. ConsoleHandler. Encoding = GBK


Method 4:

Four, console printing garbled solutions

CMD enter regedit to enter the registry

Go to HKEY_CURRENT_USER→Console→Tomcat (if you’ve changed the title bar of Tomcat, this is the name of the command window you’re opening),Find the CodePage entry, create it if not, change the value to 65001 in decimal, and click OK.