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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to