From 38fbae957ad408123b5ae6c2590aeb305c649978 Mon Sep 17 00:00:00 2001 From: Chaz Littlejohn Date: Tue, 29 Mar 2011 06:10:07 +0000 Subject: [PATCH] charset needs to be set to 'utf8' for the MySQL connection to store unicode strings correctly --- pyfpdb/Database.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 38eb802e..5481d9b9 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -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: