tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Bridges <sbridges....@yahoo.com>
Subject charset encoding bug
Date Tue, 24 Apr 2007 17:27:40 GMT
Sorry Rashmi, here is the problem without referencing
other bugs.

There is a problem with HttpServletResponse.  If I set
the content type of an HttpServletResponse, the
charset is also set.  For example consider the
following code,

HttpServletResponse sresp = ...
sresp.setContentType("application/xml");
System.out.println(sresp.getContentType());

this will print,

application/xml;charset=ISO-8859-1

When I would expect

application/xml

Tracing through the code, it seems this bug stems from
the Response.setLocale(Locale locale) method calling,
coyoteResponse.setCharacterEncoding(charset).

In the method setCharacterEncoding(String charset),
there is the line charsetSet=true;

I am using tomcat 5.5.17, jdk 1.5, windows xp.

Thanks,

Sean

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message