From 8cb9cb28c748c2aed827fd8c2110aa4bd2ab97b8 Mon Sep 17 00:00:00 2001 From: 3ll3d00d Date: Fri, 6 Oct 2023 14:56:56 +0100 Subject: [PATCH] ensure utf8 encoding --- src/main/python/app.py | 2 +- src/main/python/model/merge.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/python/app.py b/src/main/python/app.py index bcb4691c..bccfc2de 100644 --- a/src/main/python/app.py +++ b/src/main/python/app.py @@ -1146,7 +1146,7 @@ def export_beq_filter(self): from model.merge import DspType parser = HDXmlParser(DspType.MINIDSP_TWO_BY_FOUR_HD, False) output_xml, _ = parser.convert(file_path, self.__filter_model.filter) - with open(file_name, 'w+') as f: + with open(file_name, 'w+', encoding='utf8') as f: f.write(output_xml) def __open_merge_signal_dialog(self): diff --git a/src/main/python/model/merge.py b/src/main/python/model/merge.py index 19f4ed29..6b9842c3 100644 --- a/src/main/python/model/merge.py +++ b/src/main/python/model/merge.py @@ -547,7 +547,7 @@ def __write_to(self, dst: Path, entry: CatalogueEntry): dst = shutil.copy2(self.__config_file, dst.resolve()) output_config, was_optimised = self.__parser.convert(str(dst), entry.iir_filters(self.__dsp_type.target_fs)) - with dst.open('w', newline=self.__parser.newline()) as dst_file: + with dst.open('w', newline=self.__parser.newline(), encoding='utf8') as dst_file: dst_file.write(output_config) if was_optimised is False: self.__signals.on_success.emit() @@ -573,7 +573,7 @@ def __process_file(self, base_parts_idx, xml): dst = shutil.copy2(self.__config_file, dst.resolve()) filt = xml_to_filt(str(xml), fs=self.__dsp_type.target_fs) output_config, was_optimised = self.__parser.convert(str(dst), filt) - with dst.open('w', newline=self.__parser.newline()) as dst_file: + with dst.open('w', newline=self.__parser.newline(), encoding='utf8') as dst_file: dst_file.write(output_config) if was_optimised is False: self.__signals.on_success.emit()