В БД сохраняется UTF-8 строки, вместо \u

This commit is contained in:
2025-03-13 15:09:27 +03:00
parent 0eb0685115
commit df95910e42
4 changed files with 15 additions and 2 deletions

View File

@@ -50,7 +50,15 @@ class DataBase(object):
table = 'donates'
cur = self.conn.cursor()
cur.execute('INSERT INTO {table} ("data") VALUES (\'{data}\')'.format(table=table, data=json.dumps(data)))
cur.execute(
'INSERT INTO {table} ("data") VALUES (\'{data}\')'.format(
table=table,
data=json.dumps(
data,
ensure_ascii=False,
),
)
)
self.commit()
cur.close()