This is a continuation of bug #31201. The fileEncoding parameter on the DefaultServlet doesn't go far enough. The case I have is this: I have a webapp that serves some static html files directly to end user. They are encoded in shift_jis. With the current implementation the response header says the charset is iso-8859-1 for my jvm. So now I can see the correct characters in the result page but only if I explicitly tell the browser to show the page in shift_jis. I believe the DefaultServlet also needs to pass along the fileEncoding parameter as the charset in the response content type. I added the following line to the Default Servlet and it now returns a sensible content type header for any static html or text files in my web application. Compare: (<)\apache-tomcat-5.5.20-src\container\catalina\src\share\org\apache\catalina\servlets\DefaultServlet.java 738d738 < if(contentType.toLowerCase().indexOf("charset") == -1 && fileEncoding != null) contentType += ";charset="+fileEncoding; It would be great if this could be applied to the official tomcat distribution. Thanks
You can easily use your own extended servlet. I believe the current one provides the necessary features encoding wise.