From 508dd0f030bf3bb0377127e216c35fc7fc36e667 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Fri, 30 Dec 2022 16:33:39 +0100 Subject: [PATCH] Change SVG encoding Change from default 'us-ascii' to universal 'utf-8'. --- boxes/drawing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boxes/drawing.py b/boxes/drawing.py index 1a7b5fa..40973f8 100644 --- a/boxes/drawing.py +++ b/boxes/drawing.py @@ -563,7 +563,7 @@ Creation date: {date} t.set("stroke-width", f'{path.params["lw"]:.2f}') t.tail = "\n " t.tail = "\n" - tree.write(open(self._fname, "wb"), xml_declaration=True, method="xml") + tree.write(open(self._fname, "wb"), encoding="utf-8", xml_declaration=True, method="xml") class PSSurface(Surface): @@ -965,7 +965,7 @@ class LBRN2Surface(Surface): pl.tail = "\n" if self.dbg: print ("5", num) - tree.write(open(self._fname, "wb"), xml_declaration=True, method="xml", encoding="UTF-8") + tree.write(open(self._fname, "wb"), encoding="utf-8", xml_declaration=True, method="xml") from random import random