X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 332AAD1B173 for ; Sun, 20 Jun 2004 21:16:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99210-10 for ; Mon, 21 Jun 2004 00:15:39 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id AFC37D1B193 for ; Sun, 20 Jun 2004 21:15:30 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BcCT8-0004Oq-00; Mon, 21 Jun 2004 12:15:26 +1200 Message-ID: <40D628F2.7070601@opencloud.com> Date: Mon, 21 Jun 2004 12:16:50 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Andr=E9_Gomes?= Cc: pgsql-jdbc@postgresql.org Subject: Re: Question about encoding References: <000801c4523d$fceeaf00$b34ba596@munguza> In-Reply-To: <000801c4523d$fceeaf00$b34ba596@munguza> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200406/118 X-Sequence-Number: 10320 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