larryi 01/12/31 14:23:42
Modified: src/share/org/apache/tomcat/modules/generators
ErrorHandler.java
Log:
In preparation for Japanese resource strings, use a character set that
matches the default locale if different from ISO-8859-1.
Submitted by: Kazuhiro Kazama
Revision Changes Path
1.23 +8 -1
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java
Index: ErrorHandler.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ErrorHandler.java 20 Dec 2001 19:59:30 -0000 1.22
+++ ErrorHandler.java 31 Dec 2001 22:23:42 -0000 1.23
@@ -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]>