diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 78766d70..e1f63d5c 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -86,8 +86,9 @@ def _pretty_xml(element, level=0): if level and (not element.tail or not element.tail.strip()): element.tail = i if not level: - return '\n' + ET.tostring( - element, config.get("encoding", "request")) + output_encoding = config.get("encoding", "request") + return ('\n' + ET.tostring( + element, "utf-8").decode("utf-8")).encode(output_encoding) def _tag(short_name, local):