From 41b592fcd1e348a6243824f9b84e0474944daea5 Mon Sep 17 00:00:00 2001 From: iou1name Date: Wed, 27 Jun 2018 10:17:05 -0400 Subject: [PATCH] fix connection encoding issue. emoji work now --- database.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/database.py b/database.py index a6da949..c004598 100644 --- a/database.py +++ b/database.py @@ -34,7 +34,11 @@ class Database(): Opens a connection to the app's database and executes the SQL statements passed to this function. """ - with MySQLdb.connect(user=self.user,passwd=self.key,db=self.db) as cur: + with MySQLdb.connect( + user=self.user, + passwd=self.key, + db=self.db, + charset='utf8mb4') as cur: cur.execute(*args, **kwargs) return cur