Re: Character Encoding Question - Mailing list psycopg

From Federico Di Gregorio
Subject Re: Character Encoding Question
Date
Msg-id 515479EB.8020905@dndg.it
Whole thread Raw
In response to Re: Character Encoding Question  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: Character Encoding Question
List 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 by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: Character Encoding Question
Next
From: Don Parris
Date:
Subject: Re: Character Encoding Question