tomcat-users mailing list archives

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

Hello,
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 <res0ob23@verizon.net> í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" <plauko@freemail.hu> wrote in message
> news:freemail.20020723003404.85087@fm3.freemail.hu...
> 
> 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:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 
> 
> 





--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message