Question about encoding

Поиск
Список
Период
Сортировка
Искать

Question about encoding

От:
André Gomes <andre@dsc.ufcg.edu.br>
Дата:
Hi. How are you all ?
 
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 ?
 
thak you
 
[]'s
André Gomes
 

Re: Question about encoding

От:
Oliver Jowett <oliver@opencloud.com>
Дата:
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
FAQ