a better attempt at making unicode DB connections

This commit is contained in:
Brian S. Stephan 2013-05-03 15:38:46 -05:00
parent ccbea5ecdb
commit b375a5a049
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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