diff --git a/ocrd/utils.py b/ocrd/utils.py index 59cf5a30b..5754afdeb 100644 --- a/ocrd/utils.py +++ b/ocrd/utils.py @@ -75,10 +75,10 @@ def xmllint_format(xml): from lxml import etree as ET parser = ET.XMLParser(resolve_entities=False, strip_cdata=False, remove_blank_text=True) document = ET.fromstring(xml, parser) - return '%s\n%s' % ( + return ('%s\n%s' % ( '', ET.tostring(document, pretty_print=True) - ) + )).encode('utf-8') def is_string(val): # pylint: disable=undefined-variable