tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre John Mas <>
Subject Re: UTF-8 end to end - what am I doing wrong?
Date Mon, 14 Apr 2003 17:53:32 GMT
When I solved my issue I found that it was because the sender was
not in fact encoding the stream as UTF-8. This took a bit of time
before identifying the culprit. I had been using Apache Commons
HttpClient and the ordering of some of the methods in the PostMethod
make a difference. If your client is HttpClient then you should
take a look at issue #18996 in the bug database.

This said, where are you seeing the conversion error (request string,
content body, etc)? Also, is your client a web browser, and if so which, 
or a an application that you have written. If it is the latter, do you 
having a snippet of the client code that you could share with us.


Boris Folgmann wrote:
> Hi Derrick!
> Koes, Derrick schrieb:
>>You could also use a filter.
> I've done the opposite, I've written a filter to dynamically translate all
> charactes of the response to UTF-8, if the client supports it. This was
> needed because some clients of my application only understand UTF-8 and not
> ISO-8859-1, which is the tomcat default. Here's my code:
> String acceptCharset = request.getHeader("Accept-Charset");
> if (  null != acceptCharset
>     &&  -1 != acceptCharset.toUpperCase().indexOf("UTF-8"))
> {
>     response.setContentType("text/html; charset=UTF-8"); // apply only to
> web pages!!
> }
> chain.doFilter(request, response); // process desired web page
> But my big problem is, that this solution only works with tomcat 4.0.4
> (which is part of my IDE NetBeans 3.4.1) but not with the standalone tomcat
>  4.1.18. While all characters are perfectly UTF-8 encoded with 4.0.4, the
> latest tomcat seems to more or less ignore my setContentType(), because
> it's still ISO-8859-1, which I also get when do a getContentyType() in one
> of my JSPs.
> Do you have any idea what could be the problem?
> cu,
> 	boris

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message