Re: How to find freak UTF-8 character?

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: How to find freak UTF-8 character?
Дата
Msg-id CA+mi_8bFpk6h5cuU+xjfSrb8nu1+V4_31xccGFyn+TumPZiCJw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to find freak UTF-8 character?  (Leif Biberg Kristensen <leif@solumslekt.org>)
Список pgsql-general
On Sat, Oct 1, 2011 at 10:16 PM, Leif Biberg Kristensen
<leif@solumslekt.org> wrote:
> Yes I know that this is a perfectly legal UTF-8
> character. It crept into my database as a result of a copy-and-paste job from
> a web site. The point is that it doesn't have a counterpart in ISO-8859-1 to
> which I regularly have to export the data.

If your database is utf8 and the output latin1, it sounds more robust
to connect to the database with utf8 client encoding, pull data from
the database as unicode and at output time use data.encode('latin1',
'replace') in python to convert data without bombing on non-latin1
chars.

-- Daniele

В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: stored function (possible to access file system or call java program)?
Следующее
От: Bob Hatfield
Дата:
Сообщение: Replication/WAL shipping. db errors on slave after stop/start master