tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fargusson.Alan" <>
Subject RE: Encoding in Tomcat 6
Date Mon, 21 May 2007 16:30:52 GMT
Is it valid to say "charset=UTF-8"?

-----Original Message-----
From: []
Sent: Monday, May 21, 2007 7:51 AM
Subject: Encoding in Tomcat 6

Hi all,

I noticed some encoding problems inside servlets, when switching from
Tomcat 5.5.20 to Tomcat 6.0.10. I looked for it in the mailing lists,
but didn't find something appropriate.

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.

When using Tomcat 5.5 everything is displayed correctly as UTF-8. Java
Server Pages do _not_ show similar behaviour.

Has anyone experienced similar problems?

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

View raw message