tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28875] - Multi-byte characters in default error page aren't printed out correctly.
Date Tue, 20 Jul 2004 07:38:04 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28875>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28875

Multi-byte characters in default error page aren't printed out correctly.

super-creek@jcom.home.ne.jp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|Macintosh                   |All



------- Additional Comments From super-creek@jcom.home.ne.jp  2004-07-20 07:38 -------
This problem isn't yet solved in Tomcat 5.0.27 release.

It doesn't occur in 4.1.30 release, but always happens in 5.0.x release.
Any multi-byte character is not correctly printed into response reporter, 
independently of the response locale setting.

Therefore, it is impossible to read every multi-byte error messages which is 
displayed in default error page.
(And many Japanese users are in trouble very much.)

According to current ErrorReportValve source code, I have re-written my first 
proposed patch (see the following diff code).
Please apply it.

Index: jakarta-tomcat-
catalina/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat-
catalina/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java,v
retrieving revision 1.21
diff -u -w -r1.21 ErrorReportValve.java
--- jakarta-tomcat-
catalina/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java
	27 Jun 2004 23:56:23 -0000	1.21
+++ jakarta-tomcat-
catalina/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java
	17 Jul 2004 20:59:20 -0000
@@ -284,19 +284,17 @@
 
         try {
 
-            Writer writer = response.getReporter();
-
-            if (writer != null) {
-
-                Locale locale = Locale.getDefault();
-
                 try {
                 	response.setContentType("text/html");
-                	response.setLocale(locale);
+                response.setCharacterEncoding("utf-8");
                 } catch (Throwable t) {
                     if (container.getLogger().isDebugEnabled())
                         container.getLogger().debug("status.setContentType", 
t);
                 }
+
+            Writer writer = response.getReporter();
+
+            if (writer != null) {
 
                 // If writer is null, it's an indication that the response has
                 // been hard committed already, which should never happen

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message