Re: character encoding in DODS
Gilles Serasset <[email protected]> Thu, 18 Dec 2003 14:29:34 +0100
| Newsgroups | gmane.comp.java.enhydra.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Well, I don't think the solutions has been accepted.
Our context :
- All data is stored in postgres in unicode.
- Storing is just fine
- retreived values from small varchar field was OK, but fields that
are longvarchar are badly retreived.
What we did :
- We added a step to correctly reread the data in utf-8 in business
layer (i.e. dump chars->bytes using the default encoding then read
bytes->chars using utf-8 encoding.
It was quite OK for a time (in enh 3.5b and enh 5.0, I did not switch
this app to enh 5.1).
Now, we have a new problem arising only under some circumstances :
When deploying on a linux server with JDK 1.4.{1,2}, the unicode bytes
are transformed into plain "?". This is apparently done by the JDK when
8 bytes chars are encontered (Maybe the default encoding of the JDK was
plain ASCII). In this case, there is no way to reread the data which is
permanently damaged...
On the same linux box, with JDK 1.3.x, no problem.
On a Mac OS X plateform (the one we develop on) with JDK 1.3 and JDK
1.4.x: no problem also.
The only way to guaranty that everything will be OK on all plateform is
to ALWAYS specify the encoding when reading data from a database. But
you have to specifically know the encoding of the database. I'm no
specialist of JDBC, so I don't know what are really the issues here
(especially when storing is correct and reading is not...)
Regards,
Gilles,
On 18 déc. 03, at 12:00, Petr Stehlik wrote:
> Hi,
>
> we've just started using DODS of Enhydra 5.1 and now we face the
> following problem: strings in win-1250 encoding are stored via DODS to
> MySQL database correctly but when they're read back all Czech specific
> characters (ASCII > 127) are replaced with '?'.
>
> Can somebody help, please? Google found just a bug report from November
> 2001 where Gilles describes a similar problem and suggests some
> solutions but I don't know if they were ever accepted to DODS 5.x.
>
> Browsing DODS FAQ didn't help.
>
> Thanks in advance for a quick help - we should go online with this
> before Christmas :-)
>
> Petr
>
>
> _______________________________________________
> Enhydra mailing list
> [email protected]
> http://www.enhydra.org/mailman/listinfo.cgi/enhydra
>
>
--
Gilles Sérasset
GETA-CLIPS-IMAG (UJF, INPG & CNRS)
BP 53 - F-38041 Grenoble Cedex 9
Phone: +33 4 76 51 43 80
Fax: +33 4 76 44 66 75