Re: ERROR: could not convert UTF-8 character 0x00ef to ISO8859-1 possiblesolution

From: Anders Hermansen <anders(at)yoyo(dot)no>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Guillaume Cottenceau <gc(at)mnc(dot)ch>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ERROR: could not convert UTF-8 character 0x00ef to ISO8859-1 possiblesolution
Date: 2005-04-28 07:18:33
Message-ID: 20050428071833.GB13436@online.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas O'Dowd 2005-04-28 09:25:20 Re: Array support
Previous Message Kris Jurka 2005-04-28 04:47:42 Re: _pg_keyposition is gone in HEAD