From fa14fa0ccbd2b678e02ee10ac50ff013a58ae0fc Mon Sep 17 00:00:00 2001 From: pictuga Date: Mon, 9 Dec 2013 22:11:46 +0100 Subject: [PATCH] Fix encoding in feedify --- feedify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feedify.py b/feedify.py index b7c6479..e6eaecc 100644 --- a/feedify.py +++ b/feedify.py @@ -148,7 +148,8 @@ class Builder(object): self.rule = getRule(link) 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) elif self.rule['mode'] == 'json': self.doc = json.loads(data)