From: James Bunton Date: Tue, 25 Dec 2012 23:08:22 +0000 (+1100) Subject: Fixed unicode support X-Git-Url: https://code.delx.au/webdl/commitdiff_plain/8c7d6055c82b3e2b03a30d4b738c83f914a57859 Fixed unicode support --- diff --git a/autograbber.py b/autograbber.py index 4ee9555..c8c86b8 100755 --- a/autograbber.py +++ b/autograbber.py @@ -11,7 +11,7 @@ class DownloadList(object): try: self.f = open(filename, "r") for line in self.f: - self.seen_list.add(line.strip()) + self.seen_list.add(line.decode("utf-8").strip()) self.f.close() except Exception, e: print >>sys.stderr, "Could not open:", filename, e @@ -22,7 +22,7 @@ class DownloadList(object): def mark_seen(self, node): self.seen_list.add(node.title) - self.f.write(node.title + "\n") + self.f.write(node.title.encode("utf-8") + "\n") self.f.flush()