Re: UTF-8 -> ISO8859-1 conversion problem

From: Ian Pilcher <i(dot)pilcher(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: UTF-8 -> ISO8859-1 conversion problem
Date: 2004-10-29 20:56:46
Message-ID: cluaqf$smg$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Cott Lang wrote:
> ERROR: could not convert UTF-8 character 0x00ef to ISO8859-1
>
> Running 7.4.5, I frequently get this error, and ONLY on this particular
> character despite seeing quite a bit of 8 bit. I don't really follow why
> it can't be converted, it's the same character (239) in both character
> sets. Databases are in ISO8859-1, JDBC driver is defaulting to UTF-8.
>
> Am I flubbing something up? I'm probably going to (reluctantly) convert
> to UTF-8 in the database at some point, but it'd sure be nice if this
> worked without that. :)
>

Can you post a code snippet? There's really no such thing as a "UTF-8
character". Java chars and Strings are UTF-16 (or maybe UCS-2 in JVMs
prior to 1.5), not UTF-8.

Note that 0xEF should not appear by itself in a UTF-8 bytestream. The
UTF-8 representation of U+00EF is 0xC3 0xAF.

--
========================================================================
Clearly, there is no political benefit to expediting the admission of
legal immigrants into the United States. Nevertheless, I believe that
our elected officials have an obligation to do more than simply pander
to the thinly veiled racism of their constituents.
Ian Pilcher
========================================================================

In response to

Browse pgsql-general by date

  From Date Subject
Next Message stig erikson 2004-10-29 21:18:48 logging queries and time used
Previous Message Joshua D. Drake 2004-10-29 20:21:00 Re: Recommended Procedure for Archiving Table Data