mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Merge branch 'master' into testing
This commit is contained in:
commit
68bcffb57b
@ -291,10 +291,12 @@ class RSS(callbacks.Plugin):
|
|||||||
toText = utils.web.htmlToText
|
toText = utils.web.htmlToText
|
||||||
if 'encoding' in feed:
|
if 'encoding' in feed:
|
||||||
def conv(s):
|
def conv(s):
|
||||||
try:
|
# encode() first so there implicit encoding doesn't happen in
|
||||||
return toText(s).strip().encode(feed['encoding'],'replace')
|
# other functions when unicode and bytestring objects are used
|
||||||
except UnicodeEncodeError:
|
# together
|
||||||
return toText(s.encode('utf-8', 'ignore')).strip()
|
s = s.encode(feed['encoding'], 'replace')
|
||||||
|
s = toText(s).strip()
|
||||||
|
return s
|
||||||
return conv
|
return conv
|
||||||
else:
|
else:
|
||||||
return lambda s: toText(s).strip()
|
return lambda s: toText(s).strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user