tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: character encoding problem
Date Fri, 23 Aug 2002 04:34:22 GMT
I'm assuming that this is happing within a JSP page.  In which case, you
need to set:
<%@page content-type="text/html; charset=ISO-8859-2" %>
response.setContentType("text/html; charset=ISO-8859-2");

The problem is the the Writer's charset is determined by one of the above,
and will default to ISO-8859-1 (as per the spec) if not specified.

"Laukó Péter" <> wrote in message

Hi List,
I'm having problems about character encoding (latin2).
I receive string data from PostgreSQL tables and when I put them on my jsp
pages some characters are converted to "?"-s. It happens with letters "ő"
and "ű".
The data in the db is correct.
I set the character encoding in the pages by:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2">
and all characters I write _dirctly_ in the pages are displayed correctly.
I set the locale in the tomcat startup script by "export LANG=hu_HU" and
checking Locale.getDefault() gives the correct answer (huHU), but has no
The only solution I have found so far is this:
<%=new String( journal.getName().getBytes("ISO-8859-2"), "ISO-8859-1")%>
This results in the correct display but means I have to escape _all_ outputs
by hand.
There must be an easier solution. Please help!
thanks in advance, Peter

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

View raw message