From b3ff8bc7f8e9713dfb2c9e5f338e3d9421d9b103 Mon Sep 17 00:00:00 2001 From: Karl Walther Date: Sun, 15 Dec 2024 23:41:12 +0100 Subject: [PATCH] set encoding --- .CI/tests/translate_test_cases.py | 2 +- cdl_plc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.CI/tests/translate_test_cases.py b/.CI/tests/translate_test_cases.py index cbd1c96..bb61219 100644 --- a/.CI/tests/translate_test_cases.py +++ b/.CI/tests/translate_test_cases.py @@ -18,6 +18,6 @@ cxf_json = test_case + ".jsonld" cdl_plc.Cdl2Plc( cxf_json, - output_folder='check_translation_to_IEC_XML/', + # output_folder='check_translation_to_IEC_XML/', debug=True, ).translate() diff --git a/cdl_plc.py b/cdl_plc.py index b515b7d..db108cb 100644 --- a/cdl_plc.py +++ b/cdl_plc.py @@ -1147,7 +1147,7 @@ def create_iec_xml(self, debug=False): os.makedirs(directory) # Writing to sample.json - with open("{}/plc.xml".format(directory), "w") as outfile: + with open("{}/plc.xml".format(directory), "w", encoding="utf-8") as outfile: outfile.write(xml_export) def translate(self):