Thanks for the quick reply. Passing use_native_unicode=False  to 
create_engine() indeed prevents this error. Is this parameter missing in 
the docs for create_engine() 
(http://www.sqlalchemy.org/docs/core/engines.html#engine-creation-api)?

I had assumed the "encoding" parameter to set the wanted client-encoding, 
but changing it had no effect on the decode error. What is the purpose of 
this parameter, then?

The psycopg2 script detects the database encoding as "SQLASCII" and prints 
out "'St\xc3\xbcck'::character varying".
After adding
dbapi.extensions.register_type(dbapi.extensions.UNICODE, c)
indeed the decode error happens.
However, if I explicitly do  set_client_encoding('utf8'), then it prints 
without an error u"'St\xfcck'::character varying"

I had expected the "encoding" parameter of create_engine() to have the same 
purpose as set_client_encoding() of psycopg2. Did I misunderstand sth.?

-- Dirk

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/SKF1ZC6bM3oJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to