Use unicode while connecting to db
This commit is contained in:
parent
5c501cff25
commit
b8a2096f3e
1 changed files with 1 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue