tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 63792] New: The tomcat log contains garbled code because of i18n
Date Tue, 01 Oct 2019 07:12:48 GMT

            Bug ID: 63792
           Summary: The tomcat log contains garbled code because of i18n
           Product: Tomcat 9
           Version: 9.0.x
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Util
  Target Milestone: -----

The tomcat log contains garbled code which is hard to read because of i18n. If
tomcat is running in China, an example log(tomcat start log) is shown below.

Actual log:
01-Oct-2019 13:54:06.909 信息 [main] org.apache.coyote.AbstractProtocol.start
01-Oct-2019 13:54:06.925 信息 [main] org.apache.coyote.AbstractProtocol.start

Expected log:
01-Oct-2019 14:15:21.385 信息 [main] org.apache.coyote.AbstractProtocol.start
01-Oct-2019 14:15:21.397 信息 [main] org.apache.coyote.AbstractProtocol.start

It is caused by org.apache.tomcat.util.res.StringManager#getString and
java.util.PropertyResourceBundle. Prior to java 9, the PropertyResourceBundle
loads properties using encoding ISO-8859-1. The encoding ISO-8859-1 can only
represent the Latin letters, not all characters. When we use languages which
are not based on Latin letters, such as Chinese, the garbled codes appear. 

Fortunately, Java 9 and later version fix this issue by using UTF-8 instead of
ISO-8859-1 by default. Tomcat should address this issue when users use previous
version of Java 9. This issue affects branch 7.0.x, 8.5.x, 9.0.x and all the
tomcat releases after i18n. I will submit a pull request later to fix it.

You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message