From 985d382f1a5cde72109e0d7ed2db1296fe00d02a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 Aug 2011 18:18:02 -0600 Subject: [PATCH] ... --- src/calibre/ebooks/readability/readability.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/readability/readability.py b/src/calibre/ebooks/readability/readability.py index 583c84fb58..956f6f87e4 100644 --- a/src/calibre/ebooks/readability/readability.py +++ b/src/calibre/ebooks/readability/readability.py @@ -1,12 +1,15 @@ import re, sys from collections import defaultdict -from lxml.etree import tostring, tounicode +from lxml.etree import tostring from lxml.html import fragment_fromstring, document_fromstring from calibre.ebooks.readability.htmls import build_doc, get_body, get_title, shorten_title from calibre.ebooks.readability.cleaners import html_cleaner, clean_attributes +def tounicode(tree_or_node, **kwargs): + kwargs['encoding'] = unicode + return tostring(tree_or_node, **kwargs) REGEXES = {