]> git.sommitrealweird.co.uk Git - rss2maildir.git/blobdiff - rss2maildir.py
Small fix to title handling code to deal with unicode better
[rss2maildir.git] / rss2maildir.py
index b77c6d7d11ef14c2878fcdcb379829f4f9f82f1e..563da506da2d8f95307e44c38e6e0392882d3793 100755 (executable)
@@ -739,10 +739,10 @@ def parse_and_deliver(maildir, url, statedir):
             pass
         msg.add_header("Date", createddate)
         subj_gen = HTML2Text()
-        title = item["title"].encode("utf-8")
+        title = item["title"]
         title = re.sub(u'<', u'&lt;', title)
         title = re.sub(u'>', u'&gt;', title)
-        subj_gen.feed(title)
+        subj_gen.feed(title.encode("utf-8"))
         msg.add_header("Subject", subj_gen.gettext())
         msg.set_default_type("text/plain")