mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Fix RSS encoding problem
This commit is contained in:
parent
f45e0b01ac
commit
6e6fd58ea7
@ -264,8 +264,12 @@ class RSS(callbacks.Plugin):
|
|||||||
def _getConverter(self, feed):
|
def _getConverter(self, feed):
|
||||||
toText = utils.web.htmlToText
|
toText = utils.web.htmlToText
|
||||||
if 'encoding' in feed:
|
if 'encoding' in feed:
|
||||||
return lambda s: toText(s).strip().encode(feed['encoding'],
|
def conv(s):
|
||||||
'replace')
|
try:
|
||||||
|
return toText(s).strip().encode(feed['encoding'],'replace')
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
return toText(s.encode('utf-8', 'ignore')).strip()
|
||||||
|
return conv
|
||||||
else:
|
else:
|
||||||
return lambda s: toText(s).strip()
|
return lambda s: toText(s).strip()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user