Re: Character Encoding Question

Поиск
Список
Период
Сортировка
От Federico Di Gregorio
Тема Re: Character Encoding Question
Дата
Msg-id 515479EB.8020905@dndg.it
обсуждение исходный текст
Ответ на Re: Character Encoding Question  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Ответы Re: Character Encoding Question  (Don Parris <parrisdc@gmail.com>)
Список psycopg
On 28/03/2013 17:41, Daniele Varrazzo wrote:
> On Thu, Mar 28, 2013 at 4:34 PM, Don Parris <parrisdc@gmail.com> wrote:
>> > Thanks Daniele,
>> >
>> > I'm using psycopg 2.4.5 with Python 3.2.3 on Kubuntu 12.10.
>> >
>> > This is the connection encoding based on a quick check at the Python
>> > console:
>>>>> >>>>print(con.encoding)
>> > SQLASCII
> In this case it's natural that you get an error on decode. But is it
> really the database encoding? What does this query say:

IMHO this seems very much like the "uh-oh! I put latin9 data into my
database and now I am trying to read it as unicode" problem. PostgreSQL
does NOT enforce any kind of encoding. It just converts between the
client encoding and the database one before storing the data. If you
configure any of the two encodings the wrong way is quite easy to store
data in the wrong format.

federico



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

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Character Encoding Question
Следующее
От: Don Parris
Дата:
Сообщение: Re: Character Encoding Question