From b375a5a049471354c3c11ee67fdb63b2ca5ba22f Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 3 May 2013 15:38:46 -0500 Subject: [PATCH] a better attempt at making unicode DB connections --- Module.py | 3 ++- dr.botzo.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Module.py b/Module.py index 23e0efb..39e158a 100644 --- a/Module.py +++ b/Module.py @@ -208,7 +208,8 @@ class Module(object): dbuser = self.config.get('dr.botzo', 'dbuser') dbpass = self.config.get('dr.botzo', 'dbpass') dbname = self.config.get('dr.botzo', 'dbname') - db = mdb.connect(dbhost, dbuser, dbpass, dbname, use_unicode=True) + db = mdb.connect(dbhost, dbuser, dbpass, dbname, charset='utf8', + use_unicode=True) return db diff --git a/dr.botzo.py b/dr.botzo.py index 64a1f4a..c59c383 100644 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -60,7 +60,8 @@ try: dbuser = config.get('dr.botzo', 'dbuser') dbpass = config.get('dr.botzo', 'dbpass') dbname = config.get('dr.botzo', 'dbname') - db = mdb.connect(dbhost, dbuser, dbpass, dbname, use_unicode=True) + db = mdb.connect(dbhost, dbuser, dbpass, dbname, charset='utf8', + use_unicode=True) try: cur = db.cursor() # need to create the drbotzo_modules table if it doesn't exist