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=44435>.
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=44435

           Summary: Inaccuracies in the ISO-8859-1 character encoder
           Product: Tomcat 6
           Version: 6.0.14
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


In a servlet request handler, I have the following code:

response.setContentType("text/json");
response.setHeader("Cache-Control", "no-cache");
PrintWriter pw = response.getWriter();
System.out.println("Response: " + response.getClass().getName());
System.out.println("Encoding: " + response.getCharacterEncoding());
System.out.println("PrintWriter: " + pw.getClass().getName());
pw.write("é");
pw.flush();

The stdout log shows:
Response:
org.acegisecurity.context.HttpSessionContextIntegrationFilter$OnRedirectUpdateSessionResponseWrapper
Encoding: ISO-8859-1
PrintWriter: org.apache.catalina.connector.CoyoteWriter

Yet the actual response was "?" instead of "é", even though this character is
part of the later character set (ISO-8859-1)!

The following scenarios all send back the expected result ("é"):
 * The content type set to "text/json; charset=ISO-8859-1" (weird!)
 * The content type set to "text/json; charset=UTF-8"
 * The exact same code run in Jetty

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to