DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28331>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28331

Unpredictable switch from UTF-8 to other encoding in Response

           Summary: Unpredictable switch from UTF-8 to other encoding in
                    Response
           Product: Tomcat 5
           Version: 5.0.16
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Hello,

I use only UTF-8, as well as for reading from the Request as for writing into 
the Response. At unpredictable times though, Tomcat seems to switch it's 
encoding in the Response to another encoding (the platform's default 
encoding?). Here's an extract out of the log file of me sending 4 consecutive 
requests (These log() calls happen in a javax.servlet.Filter):

2004-04-10 16:37:11 StandardContext[]KOEN, encoding in RESPONSE for /edit.jsp: 
UTF-8

2004-04-10 16:37:13 StandardContext[]KOEN, encoding in RESPONSE for /edit.jsp: 
UTF-8

2004-04-10 16:37:14 StandardContext[]KOEN, encoding in RESPONSE for /edit.jsp: 
UTF-8

2004-04-10 16:37:15 StandardContext[]KOEN, encoding in RESPONSE for /edit.jsp: 
ISO-8859-1

I have tried many things, like explicitly setting the Content-Type header in 
the Response in the beginning of my page, like explicitly setting that same 
header in the Filter. Nothing works. This always happens again.

I think I didn't make a mistake, you can verify my source code:

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"; 
xmlns="http://www.w3.org/1999/xhtml"; version="2.0">
<jsp:directive.page contentType="text/html"/>

Extract of the generated source code:

response.setContentType("text/html;charset=UTF-8");

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

Reply via email to