charset needs to be set to 'utf8' for the MySQL connection to store unicode strings correctly
This commit is contained in:
parent
300340218b
commit
38fbae957a
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user