pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedjdbc: v7.1 bug (letter accent)
4+ messages / 3 participants
[nested] [flat]
* jdbc: v7.1 bug (letter accent)
@ 2001-01-29 11:11 Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>
0 siblings, 2 replies; 4+ messages in thread
From: Jean-Francois Burdet @ 2001-01-29 11:11 UTC (permalink / raw)
To: pgsql-interfaces
Hi,
I'm doing some tests to migrate an PG7.0.2 database to an PG7.1beta3.
This database contains letter with accent from french (like é in
HTML or the word café).
When using the postgresql.jar from pg7.0.2, rs.getString("name") gives
corrects results (like 'café') , but
when I move to the postgresql.jar compiled from PG7.1beta3 bundle letter
with accent are converted to '?' (like 'caf?') ...
Any one aware of this problem ? (and it's solution ?)
Thanks,
JF Burdet
My config is :
- Mandrake Linux 7.1
- JDK 1.3
- Tomcat 3.2.1
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] jdbc: v7.1 bug (letter accent)
@ 2001-01-29 18:22 Barry Lind <barry@xythos.com>
parent: Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>
1 sibling, 1 reply; 4+ messages in thread
From: Barry Lind @ 2001-01-29 18:22 UTC (permalink / raw)
To: Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>; +Cc: pgsql-jdbc@postgresql.org
What character set encoding is your database using? (select
getdatabaseencoding();)
My guess is that your database was created with the wrong character set
encoding.
thanks,
--Barry
Jean-Francois Burdet wrote:
>
> Hi,
>
> I'm doing some tests to migrate an PG7.0.2 database to an PG7.1beta3.
> This database contains letter with accent from french (like é in
> HTML or the word café).
>
> When using the postgresql.jar from pg7.0.2, rs.getString("name") gives
> corrects results (like 'café') , but
> when I move to the postgresql.jar compiled from PG7.1beta3 bundle letter
> with accent are converted to '?' (like 'caf?') ...
>
> Any one aware of this problem ? (and it's solution ?)
>
> Thanks,
>
> JF Burdet
>
> My config is :
> - Mandrake Linux 7.1
> - JDK 1.3
> - Tomcat 3.2.1
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] jdbc: v7.1 bug (letter accent)
@ 2001-01-30 09:04 Peter T Mount <peter@retep.org.uk>
parent: Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>
1 sibling, 0 replies; 4+ messages in thread
From: Peter T Mount @ 2001-01-30 09:04 UTC (permalink / raw)
To: Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>; +Cc: pgsql-jdbc@postgresql.org
Quoting Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>:
Redirecting to the jdbc list:
> Hi,
>
> I'm doing some tests to migrate an PG7.0.2 database to an PG7.1beta3.
> This database contains letter with accent from french (like é in
> HTML or the word café).
>
> When using the postgresql.jar from pg7.0.2, rs.getString("name") gives
> corrects results (like 'café') , but
> when I move to the postgresql.jar compiled from PG7.1beta3 bundle
> letter
> with accent are converted to '?' (like 'caf?') ...
>
> Any one aware of this problem ? (and it's solution ?)
Have you set the database encoding? 7.1 is encoding aware so it's probably
stripping out the accents.
--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Re: [INTERFACES] jdbc: v7.1 bug (letter accent)
@ 2001-01-30 09:37 Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>
parent: Barry Lind <barry@xythos.com>
0 siblings, 0 replies; 4+ messages in thread
From: Jean-Francois Burdet @ 2001-01-30 09:37 UTC (permalink / raw)
To: pgsql-jdbc@postgresql.org
After doing some search, I found that encoding used for the JDBC
connection
default to the JVM encoding, so I had add a Property to the connection :
info.put("user","fsft");
info.put("password","fsft");
info.put("charSet", "ISO8859_1");
dbCon = DriverManager.getConnection(url,info);
And quoted from Barry :
> Let me explain a little bit more what is happening here.
> In 7.0, the jdbc driver always used the clients default encoding to
> convert text returned from the database into java Strings. This
> obviously isn't correct when the DB happens to be running with a
> different character set than the client.
> So in 7.1 the jdbc drivers have been changed to detect the character set
> of the database (by making the select getdatabaseencoding(); call). So
> if your database was created with the wrong character set (i.e. not
> latin1), then this change in behaviour would account for your problem.
> Likewise if the database was created with the correct character set, it
> should work fine without setting any additional properties.
> As you point out, in 7.1 it is also possible to override the character
> set used by setting the property you have mentioned below. However this
> should not be necessary if the database is created with the correct
> character set.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2001-01-30 09:37 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-29 11:11 jdbc: v7.1 bug (letter accent) Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>
2001-01-29 18:22 ` Barry Lind <barry@xythos.com>
2001-01-30 09:37 ` Jean-Francois Burdet <Jean-Francois.Burdet@adm.unige.ch>
2001-01-30 09:04 ` Peter T Mount <peter@retep.org.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox