Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 334B19FB20B for ; Tue, 21 Nov 2006 10:10:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 88227-01-2 for ; Tue, 21 Nov 2006 14:10:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 2FB1A9FB33C for ; Tue, 21 Nov 2006 10:07:24 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by svr4.postgresql.org (Postfix) with ESMTP id 726FC5B0415 for ; Tue, 21 Nov 2006 13:07:59 +0000 (GMT) Received: from kingfisher.intern.logix-tt.com (84-72-188-217.dclient.hispeed.ch [84.72.188.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id B59D964BB7; Tue, 21 Nov 2006 14:10:41 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 2235A1865C802; Tue, 21 Nov 2006 14:07:38 +0100 (CET) Message-ID: <4562FA19.1050503@logix-tt.com> Date: Tue, 21 Nov 2006 14:07:37 +0100 From: Markus Schaber Reply-To: pgsql-jdbc@postgresql.org Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: stafford@marine.rutgers.edu Cc: pgsql-jdbc@postgresql.org Subject: Re: Is UTF-8 required for PostgreSQL JDBC? References: <455E1C8D.5070704@marine.rutgers.edu> In-Reply-To: <455E1C8D.5070704@marine.rutgers.edu> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/107 X-Sequence-Number: 16149 Hi, Bill, Wm.A.Stafford wrote: > When installing PostgreSQL two weeks ago I thought I read that the > encoding for a DB that will be acccessed via JDBC must be UTF-8. Is > this correct? I can not find the docs page where I saw this and I'm > beginning to wonder if I imagined it. That's wrong, the database can be in any encoding you like. The connection actually is encoded in UTF-8. PostgreSQL converts all data between UTF-8 and the actual database encoding, and the JDBC triver converts between UTF-8 and the JVM-internal unicode representation (which is likely to be an UTF-16-derivate, as that's closest to what's visible to the Java code). Executing a "SET client_encoding TO foobar" through the JDBC driver may break things for that one connection. HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org