Re: Weird unicode problem

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: Weird unicode problem
Дата
Msg-id CA+mi_8Z0m8yuNKL6yobPK8_Pm6qS65hzWr_t=9k1E+pfeO-=Gg@mail.gmail.com
обсуждение исходный текст
Ответ на Weird unicode problem  (Dick Kniep <dick@lindix.nl>)
Список psycopg
On Wed, Apr 15, 2015 at 2:50 PM, Dick Kniep <dick@lindix.nl> wrote:
> DataError: character with byte sequence 0xe2 0x82 0xac in encoding "UTF8" has no equivalent in encoding "LATIN1"

This is a PostgreSQL error: most likely your connection encoding is in
LATIN1 instead of UTF8. Proof is also that you get the error on
execute (which is normally when the data is transferred to psycopg)
and not on fetch*() (when the typecasters are applied).

Try running "show client_encoding" in you database in psql to check if
this is the case. If not, there could be something in your python code
changing the encoding: check the value of cnn.encoding where the code
is executed.

The client encoding can be changed in psycopg with a
cnn.set_client_encoding('utf8').

-- Daniele


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

Предыдущее
От: Dick Kniep
Дата:
Сообщение: Weird unicode problem
Следующее
От: "Vamsi Krishna Reddy -T (vamsredd - TATA CONSULTANCY SERVICES LIMITED at Cisco)"
Дата:
Сообщение: Need help with the installation of psycopg2 module in a python virtual env