From 6df72c09820522073d551e53170d7d24060b3522 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 24 Jun 2009 11:58:37 +1200 Subject: [PATCH] Make sure that we talk UNICODE to the database. --- services/command/database.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/command/database.py b/services/command/database.py index e096563..4de58b9 100644 --- a/services/command/database.py +++ b/services/command/database.py @@ -26,9 +26,15 @@ class DatabaseCommandManager: def __init__(self): self.db = None + + def db_set_encoding(self, con): + cursor = con.cursor() + cursor.execute("SET CLIENT_ENCODING TO UNICODE") + def start(self, connection_type, connection_dict): if self.db is None: + connection_dict['cp_openfun'] = self.db_set_encoding self.db = adbapi.ConnectionPool(connection_type, **connection_dict) -- 2.30.2