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 8207C53BA5 for ; Wed, 27 Apr 2005 08:54:44 -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 28359-10 for ; Wed, 27 Apr 2005 11:54:38 +0000 (GMT) Received: from mail44.e.nsc.no (mail44.e.nsc.no [193.213.115.44]) by svr1.postgresql.org (Postfix) with ESMTP id 3B3D953B91 for ; Wed, 27 Apr 2005 08:54:37 -0300 (ADT) Received: from seymour.intern.yoyo.no (ti122110a080-16343.bb.online.no [83.109.63.215]) by mail44.nsc.no (8.12.11/8.12.11) with ESMTP id j3RBsb77027824; Wed, 27 Apr 2005 13:54:38 +0200 (CEST) Received: from anders by seymour.intern.yoyo.no with local (Exim 3.36 #1 (Debian)) id 1DQl7i-00080e-00; Wed, 27 Apr 2005 13:54:34 +0200 Date: Wed, 27 Apr 2005 13:54:34 +0200 From: Anders Hermansen To: pgsql-jdbc@postgresql.org Cc: Guillaume Cottenceau Subject: Re: ERROR: could not convert UTF-8 character 0x00ef to ISO8859-1 possiblesolution Message-ID: <20050427115434.GB30285@online.no> Mail-Followup-To: pgsql-jdbc@postgresql.org, Guillaume Cottenceau References: <426E685F.1020600@ingenian.com> <87d5sgecyi.fsf@meuh.mnc.ch> <20050427104944.GB25361@online.no> <87y8b4cv7j.fsf@meuh.mnc.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y8b4cv7j.fsf@meuh.mnc.ch> X-Editor: Vim http://www.vim.org/ X-Operating-System: Linux/2.6.11.7 (i686) User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/174 X-Sequence-Number: 12781 * Guillaume Cottenceau (gc@mnc.ch) wrote: > Anders Hermansen writes: > > * Guillaume Cottenceau (gc@mnc.ch) wrote: > > > Isn't there a problem with your UTF-8 data containing 0x00EF? > > > > E0 to EF hex (224 to 239): first byte of a three-byte sequence. > > Well 00 is first byte here, isn't it? UTF-8 is a byte sequence, so it's not about the first byte in the whole sequence. But about the first byte in a tree byte sequece. There should be no nul (0) bytes when encoding UTF-8. I believe this is in the specification to allow it to be compatible with C nul-terminated strings. I believe that the byte sequence 0x00EF i illegal UTF-8 because: 1) It contains nul (0x00) byte 2) 0xEF is not followed by two more bytes On the other hand U+00EF is a valid unicode code point. Which points to: LATIN SMALL LETTER I WITH DIAERESIS It is encoded as 0xC3AF in UTF-8 As 0x00EF in UTF-16 (and UCS-2 ?) As 0xEF in ISO-8859-1 Anders Hermansen