Re: Question about encoding

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: André Gomes <andre(at)dsc(dot)ufcg(dot)edu(dot)br>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Question about encoding
Date: 2004-06-21 00:16:50
Message-ID: 40D628F2.7070601@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

André Gomes wrote:

> I'm trying to insert some text with chars like 'ã', 'õ'. I'm using a
> postgres database with the LATIN10 encoding, but when I try to make a
> INSERT statement via JDBC these chars aren't insert into the database,
> they are replaced by '?'. Could you help me with this question. Is this
> a problem with the JDBC driver ? or with the database itself ?

What server and driver version are you using? Are the characters in
question directly in the query string or set as a parameter via
PreparedStatement.setString()?

There is no equivalent Java encoding for LATIN10, according to a comment
in the driver (is this still true?). If you are using a pre-7.3 server,
the encoding from Java strings to the database encoding happens on the
driver side, so in this case the driver can't find a suitable encoding
to use and just uses the JVM's default encoding, which is probably wrong.

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-06-21 03:13:26 Re: ResultSet.updateCharacterStream
Previous Message Oliver Jowett 2004-06-20 14:17:21 Re: proposal for CallableStatements to handle multiple out