Browse Source

fix: charset

master
dongsuo 4 years ago
parent
commit
02d72bb637
  1. 2
      vislib/views/views.py

2
vislib/views/views.py

@ -35,6 +35,7 @@ def execSql(request):
user=username, user=username,
passwd=password, passwd=password,
db=database, db=database,
charset='utf8'
) )
db.query(sql) db.query(sql)
data = db.store_result().fetch_row(maxrows=0, how=2) data = db.store_result().fetch_row(maxrows=0, how=2)
@ -49,7 +50,6 @@ def execSql(request):
else: else:
column = key column = key
if isinstance(row[key], bytes): if isinstance(row[key], bytes):
print(row[key], key)
json_data[index][column] = row[key].decode('UTF-8', 'ignore') json_data[index][column] = row[key].decode('UTF-8', 'ignore')
else: else:
json_data[index][column] = row[key] json_data[index][column] = row[key]

Loading…
Cancel
Save