Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C5E7E2E010E for ; Fri, 22 Feb 2008 10:08:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 95556-03 for ; Fri, 22 Feb 2008 10:08:16 -0400 (AST) Received: from srv1.trusted.cz (srv1.trusted.cz [81.2.209.38]) by postgresql.org (Postfix) with ESMTP id 8B4582E0109 for ; Fri, 22 Feb 2008 10:08:24 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by srv1.trusted.cz (Postfix) with ESMTP id D54022C2AC67 for ; Fri, 22 Feb 2008 15:08:21 +0100 (CET) X-Virus-Scanned: by amavisd-new at Trusted Solutions Received: from srv1.trusted.cz ([127.0.0.1]) by localhost (srv1.trusted.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cpE4CISkh8zz for ; Fri, 22 Feb 2008 15:08:15 +0100 (CET) Received: from [10.7.0.108] (unknown [193.239.0.25]) (using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by srv1.trusted.cz (Postfix) with ESMTP id 90FDB2C2AC65 for ; Fri, 22 Feb 2008 15:08:15 +0100 (CET) Subject: UTF8 should be accepted as UNICODE From: Ivo Danihelka To: pgsql-jdbc@postgresql.org Content-Type: text/plain Date: Fri, 22 Feb 2008 15:08:14 +0100 Message-Id: <1203689294.4960.56.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200802/175 X-Sequence-Number: 18382 The Postgresql JDBC driver does not accept this statement: SET client_encoding = 'UTF8'; It fails with: "org.postgresql.util.PSQLException: The server's client_encoding parameter was changed to UTF8. The JDBC driver requires client_encoding to be UNICODE for correct operation." I consider that to be a bug. The UNICODE is an alias for UTF8. Starting from 8.2, the pg_dump exports 'UTF8' even when --encoding=UNICODE is used. See: $ pg_dump --version pg_dump (PostgreSQL) 8.2.6 $ pg_dump --encoding=UNICODE template1 | grep client_encoding SET client_encoding = 'UTF8'; The check for value.equals('UNICODE') is inside org/postgresql/core/v3/QueryExecutorImpl.java Thanks for the driver, -- Ivo Danihelka