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.

           Summary: Multi-byte characters in default error page aren't
                    printed out correctly.
           Product: Tomcat 5
           Version: Nightly Build
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


Hi, 

When working the latest Tomcat 5, any multi-byte characters in the default 
error page using ErrorReportValve are not printed out correctly.

As a result of detail investigation, I found that an error report had 
been written to the writer of response which didn't applied the 
suitable character encoding in ErrorReportValve.

So, I suggest a solution to ensure that every multi-byte character 
is normally printed out in this page, and send the following patch. 


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.16
diff -u -w -r1.16 ErrorReportValve.java
--- jakarta-tomcat-
catalina/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java
        8 May 2004 22:33:22 -0000       1.16
+++ jakarta-tomcat-
catalina/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java
        10 May 2004 10:40:52 -0000
@@ -308,19 +308,16 @@
 
         try {
 
-            Writer writer = response.getReporter();
-
-            if (writer != null) {
-
-                Locale locale = Locale.getDefault();
-
                 try {
-                    hres.setContentType("text/html");
-                    hres.setLocale(locale);
+                hres.setContentType("text/html; charset=utf-8");
                 } catch (Throwable t) {
                     if (debug >= 1)
                         log("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


I hope that this patch will be applied before next release.

Regards,

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to