You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2001/11/12 12:46:09 UTC
DO NOT REPLY [Bug 4806] New: -
include HTML page encoding problem
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4806>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4806
include HTML page encoding problem
Summary: include HTML page encoding problem
Product: Tomcat 4
Version: 4.0 Final
Platform: PC
OS/Version: Linux
Status: NEW
Severity: Major
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: burenkov@nikita.ru
When HTML page included by JSP it included with default system character
encoding... it seems to be a bug.
Typical example:
1. Pages was written in Cp1251 encoding and bundled in WAR.
2. WAR was installed on server (Linux) where default system encoding is KOI8-R.
All JSP pages includes this string:
<%@ page contentType="text/html;charset=Cp1251"%>
and JSP content displayer in browser correctly.
But when JSP page include HTML one(that was written in same encoding as JSP),
browser displays included page in unreadable encoding.
I think problem in org.apache.catalina.servlets.DefaultServlet...
all Reader's created in "copy" methods in this manner:
InputStream resourceInputStream = resourceInfo.getStream();
Reader reader = new InputStreamReader(resourceInputStream);
This mean that InputStreamReader created with default system character
encoding.
But i think Reader�s must be created with same encoding as JSP page:
InputStream resourceInputStream = resourceInfo.getStream();
String enc = resourceInfo.getEncoding();
Reader reader = new InputStreamReader(resourceInputStream, enc);
Where getEncoding(), returns encoding used by JSP page.
This bug also exists in Tomcat 3.2.3.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>