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

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to