summaryrefslogtreecommitdiffstats
path: root/extra/pyfeeparser/feedparser_utf8_decoding.patch
blob: c1779c7e9c349b2c092f0a1592b0742331754562 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
--- /var/lib/python-support/python2.5/feedparser.py     2008-01-23 20:10:27.000000000 +0100
+++ feedparser.py       2008-07-28 11:01:38.000000000 +0200
@@ -1455,7 +1455,7 @@
         # thanks to Kevin Marks for this breathtaking hack to deal with (valid) high-bit attribute values in UTF-8 feeds
         for key, value in attrs:
             if type(value) != type(u''):
-                value = unicode(value, self.encoding)
+                value = unicode(value, self.encoding, errors='replace')
             uattrs.append((unicode(key, self.encoding), value))
         strattrs = u''.join([u' %s="%s"' % (key, value) for key, value in uattrs]).encode(self.encoding)
         if tag in self.elements_no_end_tag: