Re: Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'NTPT *EXTERN*'" <NTPT(at)seznam(dot)cz>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"
Date: 2015-11-26 09:29:39
Message-ID: A737B7A37273E048B164557ADEF4A58B50FEB496@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I realize I was too short, sorry.

NTPT wrote:
> but how to update affected columns ? error message does not provide single clue ( at least row name)

For every table and every column in the source database that might be
affected, try something like:

SELECT id, col FROM tab WHERE col LIKE E'%\x96%';

Then issue UPDATE statements for the affected rows, e.g. replacing "–" with "-".

> And dump-restore ? It do not underestand how it could help.. dumped as unicode restore as unicode =
> I am at the same point ... dumping as latin2 and restore to utf8 will end with the some errors.. I
> suspect

You can run something like this over the plain text dump:

sed -e 's/–/-/g' dump.sql >fixed.sql

Of course there might be other windows characters lurking ...

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2015-11-26 10:40:50 Re: Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"
Previous Message George Neuner 2015-11-26 07:49:41 Re: using a postgres table as a multi-writer multi-updater queue