Minor change to support Chinese character in note feature

This commit is contained in:
XD-DENG
2017-07-30 12:19:01 +08:00
parent 961f17c2f5
commit 7385cb4add

View File

@@ -93,9 +93,7 @@ def write_note_into_db(id, note_to_write):
_c = _conn.cursor() _c = _conn.cursor()
current_timestamp = str(datetime.datetime.now()) current_timestamp = str(datetime.datetime.now())
command = "insert into notes values('" + id.upper() + "', '" + \ command = u"insert into notes values('{0}', '{1}', '{2}', '{3}');".format(id.upper(), current_timestamp, note_to_write, hashlib.sha1(id.upper() + current_timestamp).hexdigest())
current_timestamp + "', '" + note_to_write + \
"', '" + hashlib.sha1(id.upper() + current_timestamp + note_to_write).hexdigest() + "');"
_c.execute(command) _c.execute(command)
_conn.commit() _conn.commit()