summaryrefslogtreecommitdiff
path: root/src/lxml/html/diff.py
diff options
context:
space:
mode:
authorscoder <none@none>2008-05-26 19:47:27 +0200
committerscoder <none@none>2008-05-26 19:47:27 +0200
commit60663bdd74750b2328c1b429fb35827b4bb2bd28 (patch)
treee9e1365c8081c20a46ec594d8821fcdfe9a33ce7 /src/lxml/html/diff.py
parent662a6ecb067957257b1c6317e557b840c0176439 (diff)
downloadpython-lxml-60663bdd74750b2328c1b429fb35827b4bb2bd28.tar.gz
[svn r3755] r4371@delle: sbehnel | 2008-05-26 09:37:29 +0200
let lxml.html.diff serialise unicode strings instead of UTF-8 encoded byte strings --HG-- branch : trunk
Diffstat (limited to 'src/lxml/html/diff.py')
-rw-r--r--src/lxml/html/diff.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lxml/html/diff.py b/src/lxml/html/diff.py
index 3b3ad8e7..7344b5ca 100644
--- a/src/lxml/html/diff.py
+++ b/src/lxml/html/diff.py
@@ -750,12 +750,12 @@ def serialize_html_fragment(el, skip_outer=False):
"""
assert not isinstance(el, basestring), (
"You should pass in an element, not a string like %r" % el)
- html = etree.tostring(el, method="html", encoding="UTF-8")
+ html = etree.tostring(el, method="html", encoding=_unicode)
if skip_outer:
# Get rid of the extra starting tag:
- html = html[html.find('>'.encode("ASCII"))+1:]
+ html = html[html.find('>')+1:]
# Get rid of the extra end tag:
- html = html[:html.rfind('<'.encode("ASCII"))]
+ html = html[:html.rfind('<')]
return html.strip()
else:
return html