[Zope] Problem with ZPsycopgDA and unicode-output
Marcel Klapschus
marcel at risclog.de
Wed May 15 14:17:11 UTC 2013
I got a problem regarding the Database Output via ZPsycopgDA Adaptor in Zope 2.9:
1. My PostgresDB is encoded in UTF-8
2. My Z Psycopg 2 DB Connector is set to UTF-8
However the output of my db over the connector is somehow wrong encoded:
An Example:
In my utf-8 db it says:
"Bitte auswählen"
The db connector, however returns the following:
print repr(dbstring)
'Bitte ausw\xc3\xa4hlen'
As you can see, it looks like correct unicode, but in fact the leading "u" is missing
and a check with instance(dbstring, unicode) returns FALSE!
So actually it seems to give me an ordinary string but no real unicode-string!
My Question:
Is there any way to setup ZPsycopg2 DB Connector to return real unicode-strings from my DB?
Regards
Marcel
More information about the Zope
mailing list