From 38463fefb2aec3a1cd59f7e9efdd598296205573 Mon Sep 17 00:00:00 2001 From: Lynne Date: Tue, 10 Sep 2019 22:21:22 +1000 Subject: [PATCH] enable db unicode support --- scrape.py | 4 +++- service.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scrape.py b/scrape.py index 8390000..b041a67 100644 --- a/scrape.py +++ b/scrape.py @@ -86,7 +86,9 @@ db = MySQLdb.connect( host = cfg['db_host'], user=cfg['db_user'], passwd=cfg['db_pass'], - db=cfg['db_name'] + db=cfg['db_name'], + use_unicode=True, + charset="utf8mb4" ) cursor = db.cursor() diff --git a/service.py b/service.py index 225ac01..25964d1 100755 --- a/service.py +++ b/service.py @@ -11,7 +11,9 @@ db = MySQLdb.connect( host = cfg['db_host'], user=cfg['db_user'], passwd=cfg['db_pass'], - db=cfg['db_name'] + db=cfg['db_name'], + use_unicode=True, + charset="utf8mb4" ) print("Cleaning up database")