From: Brett Parker Date: Sun, 13 Jan 2008 16:12:16 +0000 (+0000) Subject: * Small Unicode fix for img tags. X-Git-Url: https://git.sommitrealweird.co.uk/rss2maildir.git/commitdiff_plain/5d3c474c51fe355462197e515cbc1d23be4a6cfa?ds=sidebyside * Small Unicode fix for img tags. --- diff --git a/rss2maildir.py b/rss2maildir.py index 910b8a9..113d931 100755 --- a/rss2maildir.py +++ b/rss2maildir.py @@ -180,21 +180,17 @@ class HTML2Text(HTMLParser): url = u'' for attr in attrs: if attr[0] == 'alt': - alt = attr[1] + alt = attr[1].decode('utf-8') elif attr[0] == 'src': - url = attr[1] + url = attr[1].decode('utf-8') if url: self.curdata = self.curdata \ + u' [img:' \ - + unicode( \ - url.encode('utf-8'), \ - 'utf-8') + + url if alt: self.curdata = self.curdata \ + u'(' \ - + unicode( \ - alt.encode('utf-8'), \ - 'utf-8') \ + + alt \ + u')' self.curdata = self.curdata \ + u']'