Re: JDBC driver, PGSQL 7.3.2 and accents characters

From: Carlos Correia <carlos(at)m16e(dot)com>
To: Davide Romanini <romaz(at)libero(dot)it>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC driver, PGSQL 7.3.2 and accents characters
Date: 2003-03-20 01:21:49
Message-ID: 3E7917AD.4060507@m16e.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Davide Romanini wrote:
> Hi,
>
> I've nice problems with the jdbc driver. I've tried with the jdbc2,
> jdbc, latest stable and also development release.
> I've a database in postgres with some varchar fields. The database is
> SQL_ASCII as char encoding. In that varchar fields I've stored also
> names with accents such è, à, ì etc... They work fine using the psql
> program, and also linking tables to access through the odbc driver. But
> when I try to use jdbc to connect to database my accents fail to load.
> For example I have the string 'Forlì Sud'. When I try to
> system.out.println this string catched by jdbc with rs.getString, I see
> this string instead of the original one: 'Forl?ud'.
> I've tried also to use different character sets in the connection url
> like ISO-8859-1, UNICODE, WIN, SQL_ASCII but didn't change anything.
>
Try to create the database with the LATIN9 encoding:

'createdb -E LATIN9 db-name'

Then in Java set the default locale as:

new Locale( "it", "IT", "EURO" );

(or whatever country you want -- don't forget to set the default
Timezone too, or you'll get erros from the JDBC driver)

It works with me :)

--
Carlos Correia
MEMÓRIA PERSISTENTE, Lda.
e-mail: carlos(at)m16e(dot)com
URL: http://www.m16e.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Csaba Nagy 2003-03-20 09:21:01 Re: JDBC driver, PGSQL 7.3.2 and accents characters
Previous Message Dave Cramer 2003-03-20 01:19:26 Re: Problem with updateRow()