feeds & morss: many encoding/tostring fixes

This commit is contained in:
2020-03-19 12:53:25 +01:00
parent c09b457168
commit bda51b0fc7
2 changed files with 36 additions and 27 deletions

View File

@@ -447,18 +447,23 @@ def FeedFormat(rss, options):
raise MorssException('Invalid callback var name')
elif options.json:
if options.indent:
return rss.tojson(indent=4)
return rss.tojson(encoding='UTF-8', indent=4)
else:
return rss.tojson()
return rss.tojson(encoding='UTF-8')
elif options.csv:
return rss.tocsv()
return rss.tocsv(encoding='UTF-8')
elif options.reader:
return rss.tohtml()
return rss.tohtml(encoding='UTF-8')
else:
if options.indent:
return rss.tostring(xml_declaration=True, encoding='UTF-8', pretty_print=True)
return rss.torss(xml_declaration=True, encoding='UTF-8', pretty_print=True)
else:
return rss.tostring(xml_declaration=True, encoding='UTF-8')
return rss.torss(xml_declaration=True, encoding='UTF-8')
def process(url, cache=None, options=None):