From fd22cf011d97b744ae27434182bec5e422664698 Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 20 Feb 2014 13:28:10 +0100 Subject: [PATCH] plugin text syntaxes: fixed cleaners encoding --- src/plugins/plugin_misc_text_syntaxes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugin_misc_text_syntaxes.py b/src/plugins/plugin_misc_text_syntaxes.py index 0663dfb2..f6ff1e0b 100755 --- a/src/plugins/plugin_misc_text_syntaxes.py +++ b/src/plugins/plugin_misc_text_syntaxes.py @@ -182,7 +182,7 @@ class TextSyntaxes(object): xhtml_elt = cleaner.clean_html(xhtml_elt) for elt in xhtml_elt.xpath("//*[@style]"): elt.set("style", clean_style(elt.get('style'))) - return html.tostring(xhtml_elt, method='xml') + return html.tostring(xhtml_elt, encoding=unicode, method='xml') return deferToThread(blocking_cleaning, xhtml) @@ -256,4 +256,4 @@ class TextSyntaxes(object): """ cleaner = clean.Cleaner(kill_tags=['style']) cleaned = cleaner.clean_html(html.fromstring(xhtml)) - return html.tostring(cleaned, method="text") + return html.tostring(cleaned, encoding=unicode, method="text")