From 5d3c474c51fe355462197e515cbc1d23be4a6cfa Mon Sep 17 00:00:00 2001 From: Brett Parker Date: Sun, 13 Jan 2008 16:12:16 +0000 Subject: [PATCH] * Small Unicode fix for img tags. --- rss2maildir.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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']' -- 2.39.5