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")