You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Sand <rs...@vgalleries.com> on 2002/02/21 18:55:21 UTC

still suffering character-encoding woes

Hi all,

I've read with interest the recent threads about how to get posted form data
to be handled properly containing special alphabetic characters used in many
european languages.  I've tried every suggestion that I saw in the threads
to no avail, and am starting to tear my hair out.  A quick summary:

My development environment is Apache1.3.20, Tomcat 4.0.1, DB/2 on
Windows2000, locale = Norwegian
My production environment switches the database to Postgres and OS to Linux,
environment has LANG=C and LC_CTYPE=iso-8859-1

Basically, on my development environment, everything works perfectly- i can
post data containing norwegian characters and they are stored properly in
the database and logged properly in the log files.

On the production server, its '?' everywhere.

Now to fix the problem, I've tried the following steps, in sequence:

1) I cut apache out of the loop and accessed tomcat directly to see if it
interfered at all- no change
2) I added <META HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=UTF-8"> to inside my html-head tags
3) I added <%@ page contentType="text/html; charset=UTF-8"> to my JSP pages
4) Finally, I tried doing request.setCharacterEncoding("UTF-8") at the top
of my doGet and doPut methods

None of the first 3 steps helped- still that '?'- I should point out that if
I did <%=request.getParameter("someparam")%> in my JSP page I saw my special
characters echoed back; somehow the corruption of my post data happens only
when I write the data to a log file or into a database.

And when I tried step 4, suddenly all of my strings got terminated whenever
a special character occured- in other words, instead of a '?' it was as if
the string was terminated by a '\0'.

Can anyone help?!?!

Thanks!

Best regards,

Richard








--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>