]> git.sommitrealweird.co.uk Git - rss2maildir.git/commitdiff
Small fix to title handling code to deal with unicode better
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Tue, 17 Mar 2009 12:08:18 +0000 (12:08 +0000)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Tue, 17 Mar 2009 12:08:18 +0000 (12:08 +0000)
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()
             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)
         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")
 
         msg.add_header("Subject", subj_gen.gettext())
         msg.set_default_type("text/plain")