tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laukó Péter <>
Subject Re: character encoding problem
Date Fri, 23 Aug 2002 23:06:42 GMT

yes I use JSP. If I put any of these lines in the page the strings from the db become correct,
but the characters written directly in the page go wrong. (just the opposite situation as
before.) What's the way to get them work together???
Thanks for your answer, Peter

Bill Barker <> írta:

> 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
> effect.
> 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: <>

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

View raw message