charset needs to be set to 'utf8' for the MySQL connection to store unicode strings correctly

This commit is contained in:
Chaz Littlejohn 2011-03-29 06:10:07 +00:00
parent 300340218b
commit 38fbae957a

View File

@ -399,7 +399,12 @@ class Database:
if use_pool:
MySQLdb = pool.manage(MySQLdb, pool_size=5)
try:
self.connection = MySQLdb.connect(host=host, user=user, passwd=password, db=database, use_unicode=True)
self.connection = MySQLdb.connect(host=host
,user=user
,passwd=password
,db=database
,charset='utf8'
,use_unicode=True)
self.__connected = True
#TODO: Add port option
except MySQLdb.Error, ex: