Dear Tomcat 3.3 committers,

The atached two patches resolve character corruption problems when
Tomcat 3.3 lists directories or displays an error message in
non-ISO-8859-1 environments.

And I created Japanese resource bundles for Tomcat 3.3 according to
Henri Gomez's advice (Note: they requires the attached patches). I
think it is better to send them to one of committers because they are
a little bit huge.

Could anyone recieve them and commit them to Tomcat 3.3 CVS?

Kazuhiro Kazama ([EMAIL PROTECTED])     NTT Network Innovation Laboratories

Index: src/share/org/apache/tomcat/modules/generators/StaticInterceptor.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/StaticInterceptor.java,v
retrieving revision 1.15
diff -c -u -r1.15 StaticInterceptor.java
--- src/share/org/apache/tomcat/modules/generators/StaticInterceptor.java       
2001/08/12 02:13:25     1.15
+++ src/share/org/apache/tomcat/modules/generators/StaticInterceptor.java       
+2001/12/13 07:38:04
@@ -465,7 +465,13 @@
        }
 
        if (! inInclude) {
-           res.setContentType("text/html");
+           String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
+           if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
+               res.setContentType("text/html");
+           else {
+               res.setContentType("text/html; charset=" + charset);
+               res.setUsingWriter(true);
+           }
            buf.write("<html>\r\n");
            buf.write("<head>\r\n");
            buf.write("<title>");
Index: src/share/org/apache/tomcat/modules/generators/ErrorHandler.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java,v
retrieving revision 1.20
diff -c -u -r1.20 ErrorHandler.java
--- src/share/org/apache/tomcat/modules/generators/ErrorHandler.java    2001/10/06 
02:31:10     1.20
+++ src/share/org/apache/tomcat/modules/generators/ErrorHandler.java    2001/12/13 
+07:38:35
@@ -63,6 +63,7 @@
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.qlog.Logger;
 import org.apache.tomcat.util.http.HttpMessages;
+import org.apache.tomcat.util.http.LocaleToCharsetMap;
 import java.io.*;
 import java.net.*;
 import java.util.*;
@@ -573,7 +574,13 @@
 
        // only include <head>...<body> if reset was successful
        if ( needsHead ) {
-           res.setContentType("text/html");
+           String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
+           if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
+               res.setContentType("text/html");
+           else {
+               res.setContentType("text/html; charset=" + charset);
+               res.setUsingWriter(true);
+           }
            res.setStatus( 500 );
        
            buf.append("<head><title>");

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

Reply via email to