Fix encoding in feedify

master
pictuga 2013-12-09 22:11:46 +01:00
parent d2345a94f8
commit fa14fa0ccb
1 changed files with 2 additions and 1 deletions

View File

@ -148,7 +148,8 @@ class Builder(object):
self.rule = getRule(link) self.rule = getRule(link)
if self.rule['mode'] == 'xpath': if self.rule['mode'] == 'xpath':
self.data = morss.decodeHTML(self.data) if not isinstance(self.data, unicode):
self.data = self.data.decode(morss.detEncoding(self.data), 'replace')
self.doc = lxml.html.fromstring(self.data) self.doc = lxml.html.fromstring(self.data)
elif self.rule['mode'] == 'json': elif self.rule['mode'] == 'json':
self.doc = json.loads(data) self.doc = json.loads(data)