Skip site navigation (1) Skip section navigation (2)

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

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-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)
> 
> 



In response to

pgsql-jdbc by date

Next:From: Marcel Fr├ęchetteDate: 2001-11-29 21:26:38
Subject: Re: Using Postgresql under IBM WebSphere
Previous:From: Marcel Fr├ęchetteDate: 2001-11-29 17:35:30
Subject: Using Postgresql under IBM WebSphere

pgsql-general by date

Next:From: Eugene BregmanDate: 2001-11-29 18:31:36
Subject: libpq in a multithreaded environment
Previous:From: Jason EarlDate: 2001-11-29 17:08:02
Subject: Re: Licensing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group