Telling Psycopgda2 to return unicode strings
26 Jul
2007
26 Jul
'07
12:10 p.m.
Hi, I don't know if this is common knowledge, but I couldn't find anything about it on the web. So I hacked it myself. When querying a Postgresql database using unicode in Zope 2.10 via ZPsycopgda2, the adapter will return unicode data in plain strings. To force unicode strings to be returned go to your Products folder and create a directory like ZPsycopgda2SetUnicode. In this directory put an __init__.py file containing this code: import psycopg2 import psycopg2.extensions psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) After this restart Zope. ZPsycopgda2 should now return unicode strings. - Andreas
6828
Age (days ago)
6828
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andreas Elvers