Re: Problems with charsets, investigated... - Mailing list pgsql-jdbc

From Jan de Visser
Subject Re: Problems with charsets, investigated...
Date
Msg-id 200408072312.36614.jdevisser@digitalfairway.com
Whole thread Raw
In response to Re: Problems with charsets, investigated...  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
On August 7, 2004 10:29 pm, Oliver Jowett wrote:
> > 6) Our web app choses to display Java Strings accordingly to
> > file.encoding, therefore as ISO-8859-1
> > 7) Bing ! problem: we are now interpreting UTF8-encoded strings (see
> > point 2/3) as ISO-8859-1
> > Therefore all the accentuated characters go wrong !
>
> This implies that your web app is not transcoding correctly from UTF-16
> (internal string representation) to ISO-8859-1.
>
> How does your web app use file.encoding exactly? Note that the
> file.encoding property does *not* control the default encoding used by
> String.getBytes(), as I understand it; the default eencoding is
> JVM-controlled from the system's locale settings.

Hrm. This rings a bell. We use JBoss 3.2.3, which ships with a broken tomcat.
That particular tomcat version hardcodes a transcoding to LATIN1. Caused us a
lot of hair-pulling, and we fixed it by patching the offending code in tomcat
(in coyote, actually). This is the README in our lib-hacks CVS dir:

"
This directory contains a patch for tomcat/coyote 4.1.29 as shipped with jboss
3.2.3. It will set the default encoding to UTF-8 as opposed to ISO-8859-1,
and will set the encoding on the query string as well as on the request body.

The build script will compile the patched files, and add the patched classes
to the tomcat jars stored in jboss/server/deploy/jbossweb-tomcat41.sar.
"

Could this be his problem?

JdV!!

--
--------------------------------------------------------------
Jan de Visser                     jdevisser@digitalfairway.com

                Baruk Khazad! Khazad ai-menu!
--------------------------------------------------------------

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Problems with charsets, investigated...
Next
From: Alexandre Aufrere
Date:
Subject: Re: Problems with charsets, investigated...