When the terminal runs the Tomcat server today, there are garbled characters, which are all incomprehensible. This is the problem caused by the different encoding and decoding methods of files. The default encoding mode of Tomcat files is UTF-8, and our Windows may be GBK encoding, thus causing garbled characters (as shown in Figure 1). Write this blog to document the solution.
Here’s what the main files do under Tomcat (see Figure 2) :
(figure 2)
Garbled solution: Modify Tomcat conf configuration folder logging. The properties file of Java. Util. Logging. ConsoleHandler. Encoding = Utf-8 to Java. Util. Logging. ConsoleHandler. GBK encoding = (as shown in figure 3)
(figure 3)