Help with ERROR: character 0xc280 of encoding "UTF8" has no equivalent in "WIN1252"

From: "Scot Kreienkamp" <SKreien(at)la-z-boy(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Help with ERROR: character 0xc280 of encoding "UTF8" has no equivalent in "WIN1252"
Date: 2011-06-13 19:42:07
Message-ID: 59E62072D4EFFF4BB912EC607F8FA60B02ECCE50@lzbs6304.na.lzb.hq
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi everyone,

I have a database that is UTF8, and a client that is connecting using
client encoding WIN1252. There are a few records in my database that
somehow have gotten characters in them that are not viewable. When
viewing the records from the command line using UTF8 client encoding
there are strange looking characters, and the records cause an error
when viewing under WIN1252 encoding.

I cannot modify the data, so my alternative was this query, which I
found an example for on a list that Google was kind enough to translate
from French for me:

set client_encoding to 'WIN1252' ;

SELECT soldnotesid,soldid,regexp_replace(notes, E'\u008C', ' ', 'g') as
notes,
privatenote,modified,userloginid,notetype,sourcekey,hidden,notesmodified
,notesmodifiedby,created from soldnotes where soldid<'317773002' and
soldid>'317771002'

However, it still errors out: psql:sql3:7: ERROR: character 0xc280 of
encoding "UTF8" has no equivalent in "WIN1252"

Is there any way to mask these "bad" characters from the field in a
query to allow the client to work? I'll put it in a view once I get it
working so the end users can use the view.

PG 8.3.7.

Thanks for any help you can provide.

Scot Kreienkamp

This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, please note that you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.

Browse pgsql-general by date

  From Date Subject
Next Message Day, David 2011-06-13 20:43:37 Postgres V9.0.3 and Avahi Zeroconfig
Previous Message Andreas Joseph Krogh 2011-06-13 19:34:27 Having a equal (=) operator on GIN-indexable columns