From: Radek Czajka Date: Tue, 8 Mar 2011 12:07:08 +0000 (+0100) Subject: encode unicode for lxml X-Git-Tag: 1.7~203 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/fec62da2886e29aa0a9233e13fd9cae0ca6076bf encode unicode for lxml --- diff --git a/librarian/parser.py b/librarian/parser.py index 4cdaa79..afc4f1a 100644 --- a/librarian/parser.py +++ b/librarian/parser.py @@ -61,7 +61,7 @@ class WLDocument(object): try: parser = etree.XMLParser(remove_blank_text=False) - tree = etree.parse(StringIO(data), parser) + tree = etree.parse(StringIO(data.encode('utf-8')), parser) if swap_endlines: cls.swap_endlines(tree)