How to correct this encoding/decoding issue with lists?

Поиск
Список
Период
Сортировка
От Federico Leoni
Тема How to correct this encoding/decoding issue with lists?
Дата
Msg-id CAPBBA9yfoU6xUT_yBsC1K2imnvNC=QxvaK2-zC4UZzCc+L5+tQ@mail.gmail.com
обсуждение исходный текст
Список pgsql-novice
On a python script I have:

cur.execute(
    "SELECT product_template.name FROM public.pos_order_line,
public.product_template "
    "WHERE pos_order_line.product_id = product_template.id AND
pos_order_line.order_id >= 338 "
    "ORDER BY pos_order_line.id DESC;")
checkname = cur.fetchone()[0]
if checkname.startswith('#'):
    nametmp = checkname
    print checkname, nametmp

In this case the print output is ok:

# + Orégano # + Orégano

Process finished with exit code 0

But if I create a list for nametmp (and is what I need) I get:

    nametmp.insert(0, checkname)
    print checkname, nametmp

# + Orégano ['# + Or\xc3\xa9gano']

Process finished with exit code 0
I'm in Brazil, then my normal encoding should be latin1 but even if I put

# -*- coding: utf-8 -*-

at the start of my .py the result is the same. How can I resolve this issue?

Thanks.

Federico


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

Предыдущее
От: wanna_be
Дата:
Сообщение: Re: query nested levels in jsonb
Следующее
От: Norbert Kiam Maclang
Дата:
Сообщение: Tainted kernel possible caused by postgresql