tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikola Milutinovic <>
Subject Re: Problem with iso-8859-2 charset
Date Thu, 03 Jan 2002 12:44:26 GMT
Maciej Ko³odziej wrote:

> Hi,
> In Your mail sent Wednesday, January 02, 2002 I wrote:
> MK> I'm  using  Tomcat 3.3 on Linux Debian unstable system. Everything was
> MK> fine  until  I made an upgrade of the distribution. Now all iso-8859-2
> MK> chars  are  returned  as  two-byte  values  (Unicode?),  and  I can see
> MK> question  marks  and  squares  instead of letters. Does anyone have an
> MK> idea what can it be? Configuration problem? Same jsp pages worked fine
> MK> before the upgrade.

To what version?

> I found some new interesting information about this behavior:
> First,  in  case  described  above,  if I choose Encoding->UTF-8 in my
> browser everything looks  fine.
> That means, that Tomcat(?) converts chars from iso-8859-2 in .jsp file
> to  unicode on the server output. So setting the page charset to utf-8
> in <meta> should work.

So, Tomcat is just plain spitting it out. It is a bit strange that it should 
print it as UTF-8. My understanding is that, if not specified, Tomcat will use 
default JVM character encoding to convert the output. The default is, usually, 

This is usually derived from UNIX "locale" environment.

> Second,  I  found,  that if I use a <bean:message .../> tag to insert
> text  from  properties  file  and  the text contains polish characters
> entered  in  unicode  (like \u0105) then the encoding on the output is
> back iso-8859-2, so there is conversion, but in this case from Unicode
> to iso-8859-2 (browser is set to iso-8859-2).
> So  the problem is partially solved, because I can choose one of these
> solutions  to get desirable result. But I'm just curious - what can be
> the cause of that?

Have you set JSP page output encoding properly? I found out that my troubles 
were caused by "misinterpreting" JSP specification - "pageEncoding" atribute 
doesn't do the job, I had to use "contentType" instead. So, something like this 
should work:

<%@ page
   info="Test page"
   contentType="text/html; charset=iso-8859-2"
<title>Test page</title>
<meta http-equiv="Content-Type" value="text/html; charset=iso-8859-2">



To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message