From ea89be5f4a2ef52c70533d1c3fbde756063fd2ff Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 8 Jan 2013 10:40:51 +0900 Subject: [PATCH] make sure we encode data as utf8 before checksumming --- anki/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/anki/utils.py b/anki/utils.py index e4209f190..eef69e8ce 100644 --- a/anki/utils.py +++ b/anki/utils.py @@ -240,6 +240,8 @@ def splitFields(string): ############################################################################## def checksum(data): + if isinstance(data, unicode): + data = data.encode("utf-8") return sha1(data).hexdigest() def fieldChecksum(data):