How to find freak UTF-8 character?

From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: How to find freak UTF-8 character?
Date: 2011-10-01 05:55:01
Message-ID: 201110010755.01848.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've somehow introduced a spurious UTF-8 character in my database. When I try
to export to an application that requires LATIN1 encoding, my export script
bombs out with this message:

psycopg2.DataError: character 0xe2808e of encoding "UTF8" has no equivalent in
"LATIN1"

I figure that it should be easy to find the offending character in the database
by doing a SELECT * FROM foo WHERE bar like '%\0xe2808e%' or something like
that, but I can't find the correct syntax, I can't find a relevant section in
the manual, and I can't figure out how to google this problem.

regards, Leif

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leif Biberg Kristensen 2011-10-01 06:23:19 Re: How to find freak UTF-8 character?
Previous Message Craig Ringer 2011-09-30 23:46:07 Re: stored procs