mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #980 (error fectching a source with more than one rss feed)
This commit is contained in:
parent
964727579f
commit
f839c4d9a9
@ -437,7 +437,7 @@ class HTMLConverter(object, LoggingInterface):
|
||||
for s in props.split(';'):
|
||||
l = s.split(':',1)
|
||||
if len(l)==2:
|
||||
key = str(l[0].strip()).lower()
|
||||
key = l[0].strip().lower()
|
||||
val = l[1].strip()
|
||||
prop [key] = val
|
||||
return prop
|
||||
|
@ -1452,7 +1452,7 @@ class _BaseHTMLProcessor(sgmllib.SGMLParser):
|
||||
# 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, '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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user