tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Schönhaber <>
Subject Re: Encoding in Tomcat 6
Date Mon, 21 May 2007 16:08:30 GMT wrote:

> Scenario:
> An own servlet (that is: a class derived from HttpServlet) is creating
> very simple HTML output, containing (beside the necessary HTML tags
> <html>,<body> etc.) just some German special characters (ä ö ü).
> The java source code is UTF-8, the response instance is configured via
>   response.setContentType( "text/html;charset=UTF-8" );
> Just for safety I also added
>   response.setCharacterEncoding( "UTF-8" );
> The created HTML text contains a meta tag
>   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> Nevertheless: when calling the corresponding URL, all the special
> characters are not displayed correctly in the browser (Firefox), when
> using Tomcat 6. If I switch the encoding of the displayed page to
> ISO-8859-1 in Firefox the characters are displayed correctly. That is:
> it seems to me that everything is okay with the servlet, except that the
> used encoding for the response is ISO-8859-1 instead of UTF-8.

Works fine for me.
You do call response#setContentType before response#getWriter, don't you?
There's no filter changing things?

BTW: I consider LiveHTTPHeaders an incredibly useful Firefox extension
when it comes to finding out which headers the server really sends.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message