Use unicode while connecting to db

This commit is contained in:
Anand Doshi 2012-02-03 15:26:24 +05:30
parent 5c501cff25
commit b8a2096f3e

View file

@ -65,7 +65,7 @@ class Database:
"""
Connect to a database
"""
self._conn = MySQLdb.connect(user=self.user, host=self.host, passwd=self.password)
self._conn = MySQLdb.connect(user=self.user, host=self.host, passwd=self.password, use_unicode=True)
self._conn.set_character_set('utf8')
self._cursor = self._conn.cursor()