Re: Current JDBC Driver char encoding - Bug or feature?

Lists: pgsql-generalpgsql-jdbc
From: Jan Wessely <jawe(at)vknn(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Current JDBC Driver char encoding - Bug or feature?
Date: 2001-11-29 11:06:56
Message-ID: MPG.167034ec175eef5989680@news.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

Hello Postgres & JDBC gurus,

We recently upgraded from jdbc7.0-1.2.jar to jdbc7.1-1.2.jar and now non-
ASCII characters display as ?. That was not the case with the old driver.

Our Postgres Installation was built with --enable-locale but not with
--enable-multibyte or anything else differing from the default config.

psql displays that characters correctly when printing query results.

Any hints what we can do about this?

Can't imagine that I have to reconfigure the backend when the JDBC driver
changes.
We can't fall back to the old driver because of various other bugs or
unimplemented methods there.

Please forgive if that issue was discussed already, I really tried to
find related messages, but...

TIA, jan

--
Jan Wessely
Vienna Knowledge Net
mailto:jawe(at)vknn(dot)org
http://www.vknn.org


From: Barry Lind <barry(at)xythos(dot)com>
To: Jan Wessely <jawe(at)vknn(dot)org>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Current JDBC Driver char encoding - Bug or feature?
Date: 2001-11-29 17:43:40
Message-ID: 3C0673CC.20206@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

Jan,

You have three options:

1) Enable multibyte on your server and create your database with the
encoding that your data is in (i.e. if you are storing Latin1 characters
you should create your database with the Latin1 encoding).

2) In your jdbc connection URL specify explicitly the encoding you want
the jdbc driver to use. (i.e. add ?charSet=XXX to the end of the URL, I
don't recal if this takes the postgres encoding names, or the java ones)

3) Use the latest driver from 7.2.

The problem is that the 7.1 driver started to use the encoding that the
database specified the database was created in, to do conversions.
Unfortunately if the server isn't built with multibyte enabled it always
reports the database encoding as SQL_ASCII. SQL_ASCII is 7bit ascii.
Thus any 8bit characters are converted to ?s.

thanks,
--Barry

Jan Wessely wrote:

> Hello Postgres & JDBC gurus,
>
> We recently upgraded from jdbc7.0-1.2.jar to jdbc7.1-1.2.jar and now non-
> ASCII characters display as ?. That was not the case with the old driver.
>
> Our Postgres Installation was built with --enable-locale but not with
> --enable-multibyte or anything else differing from the default config.
>
> psql displays that characters correctly when printing query results.
>
> Any hints what we can do about this?
>
> Can't imagine that I have to reconfigure the backend when the JDBC driver
> changes.
> We can't fall back to the old driver because of various other bugs or
> unimplemented methods there.
>
> Please forgive if that issue was discussed already, I really tried to
> find related messages, but...
>
> TIA, jan
>
> --
> Jan Wessely
> Vienna Knowledge Net
> mailto:jawe(at)vknn(dot)org
> http://www.vknn.org
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>