From 02d72bb6377385e0d05e4edfc992b314aefbe178 Mon Sep 17 00:00:00 2001 From: dongsuo Date: Tue, 3 Nov 2020 23:59:50 +0800 Subject: [PATCH] fix: charset --- vislib/views/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vislib/views/views.py b/vislib/views/views.py index 5cb7ec0..83c2c4c 100644 --- a/vislib/views/views.py +++ b/vislib/views/views.py @@ -35,6 +35,7 @@ def execSql(request): user=username, passwd=password, db=database, + charset='utf8' ) db.query(sql) data = db.store_result().fetch_row(maxrows=0, how=2) @@ -49,7 +50,6 @@ def execSql(request): else: column = key if isinstance(row[key], bytes): - print(row[key], key) json_data[index][column] = row[key].decode('UTF-8', 'ignore') else: json_data[index][column] = row[key]