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 00DE8545EE for ; Thu, 28 Apr 2005 04:18:46 -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 18258-01 for ; Thu, 28 Apr 2005 07:18:37 +0000 (GMT) Received: from mail44.e.nsc.no (mail44.e.nsc.no [193.213.115.44]) by svr1.postgresql.org (Postfix) with ESMTP id CD4F7545D7 for ; Thu, 28 Apr 2005 04:18:35 -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 j3S7IWWv022751; Thu, 28 Apr 2005 09:18:33 +0200 (CEST) Received: from anders by seymour.intern.yoyo.no with local (Exim 3.36 #1 (Debian)) id 1DR3I9-0003Zb-00; Thu, 28 Apr 2005 09:18:33 +0200 Date: Thu, 28 Apr 2005 09:18:33 +0200 From: Anders Hermansen To: Tom Lane Cc: Guillaume Cottenceau , pgsql-jdbc@postgresql.org Subject: Re: ERROR: could not convert UTF-8 character 0x00ef to ISO8859-1 possiblesolution Message-ID: <20050428071833.GB13436@online.no> Mail-Followup-To: Tom Lane , Guillaume Cottenceau , pgsql-jdbc@postgresql.org References: <426E685F.1020600@ingenian.com> <87d5sgecyi.fsf@meuh.mnc.ch> <20050427104944.GB25361@online.no> <87y8b4cv7j.fsf@meuh.mnc.ch> <20050427115434.GB30285@online.no> <873btccqgw.fsf@meuh.mnc.ch> <22055.1114612618@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22055.1114612618@sss.pgh.pa.us> 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=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/190 X-Sequence-Number: 12797 * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Looking at the source code, it's clear that it's reporting just the > first byte of the sequence; the 00 is redundant and probably shouldn't > be in the message. Yes the error message can be a bit confusing. I investigated a error I got when using psql. I did a select and got the message: "ERROR: could not convert UTF-8 character 0x00e2 to ISO8859-1" When looking at the database dump the byte sequence is 0xE2 0x80 0x93, which is valid UTF-8 (U+2013 EN DASH), but can not be converted because the character is not found in ISO-8859-1. If I start up a UTF-8 xterm and psql with UNICODE encoding, then everything works as expected. > There seem to be two possibilities: either there is a valid 3-byte > UTF8 character, which cannot be converted to LATIN1; or the alleged > UTF8 data isn't really UTF8 at all. Yes. Maybe the error messages can be changed so that what actually went wrong is more clear? And possibly printing the whole 3-byte sequence? Anders Hermansen