From 0e3bc0a2fd35a12d777dc56d139f078c18425431 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 10 Mar 2021 15:35:47 -0500 Subject: [PATCH] Use unicode when reading/writing svgs --- scripts/add-bounds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/add-bounds.py b/scripts/add-bounds.py index 99c613a6..5b6a01e0 100644 --- a/scripts/add-bounds.py +++ b/scripts/add-bounds.py @@ -16,10 +16,10 @@ for path in Path(sys.argv[1]).rglob('*.svg'): # I'd rather avoid mangling the XML files by parsing them first # XML is awful and we never should have invented it :( - with open(path, "r") as file: + with open(path, "r", encoding="utf-8") as file: data = file.read() data = re.sub('viewBox="0 0', f'width="{width}" height="{height}" viewBox="0 0', data) - with open(path, "w") as file: + with open(path, "w", encoding="utf-8") as file: file.write(data) \ No newline at end of file