Thread: Charset problem

Charset problem

From
Lily
Date:
Hi,

I use Postgresql 7.0 running on Mandrake 8.0. I've created a database, but
when, in my jsp pages, i retrieved data, accentuated characters are showed
incorrectly. Could it come from Postgresql ? Both Linux and Windows (test
machine) use iso8859-1.

Thanks !
Regards,
Lily
www.khamoon.com


Re: Charset problem

From
Jani Averbach
Date:
On Fri, 19 Oct 2001, Lily wrote:

>
> I use Postgresql 7.0 running on Mandrake 8.0. I've created a database, but
> when, in my jsp pages, i retrieved data, accentuated characters are showed
> incorrectly. Could it come from Postgresql ? Both Linux and Windows (test
> machine) use iso8859-1.
>

Yes and no, please look at following links:
http://www3.us.postgresql.org/users-lounge/docs/7.1/admin/multibyte.html

and for background information please read following thread:
http://archives2.us.postgresql.org/pgsql-jdbc/2001-05/msg00018.php

(I suppose that you are using pgsql-jdbc driver...)

BR, Jani

---
Jani Averbach



Re: Charset problem

From
Tatsuo Ishii
Date:
> > I use Postgresql 7.0 running on Mandrake 8.0. I've created a database, but
> > when, in my jsp pages, i retrieved data, accentuated characters are showed
> > incorrectly. Could it come from Postgresql ? Both Linux and Windows (test
> > machine) use iso8859-1.

Please make sure that psql shows them incorrectly. If not, your
problems are with JDBC or Java or your servlets, not with PostgreSQL
backend.
--
Tatsuo Ishii

Re: Charset problem

From
Jani Averbach
Date:
On Wed, 24 Oct 2001, Tatsuo Ishii wrote:

>
> Please make sure that psql shows them incorrectly. If not, your
> problems are with JDBC or Java or your servlets, not with PostgreSQL
> backend.
>

Well, I would argue with that.

I was in the situation where psql shows chars correctly, but them has been
showed incorrectly by java.

And the reason is that:
(quete from Barry Lind's email)

Now it turns out that Postgres is a little lax in its character set
support, so you can very easily insert char/varchar/text with values
that fall outside the range of valid values for a given character set
(and psql doesn't really care either).  However in java since we must do
character set conversion to unicode, it does make a difference and any
values that were inserted that are incorrect with regards to the
database character set will be reported as ?'s in java.

<http://archives2.us.postgresql.org/pgsql-jdbc/2001-05/msg00023.php>

I have been hit my toe to stone once with that problem, and the cure
was: There have to be backend compiled with multibyte support, and set up
with correct char set.

IMHO, the main problem is that 8-bit speaking people don't think that they
will need multibyte support. If you figure that out, you will be salvaged
because the actual multibyte doc is very good and clear.

BR, Jani

--
Jani Averbach