diff --git a/aospdtgen/device_tree.py b/aospdtgen/device_tree.py index 715fb57..ae7eda8 100644 --- a/aospdtgen/device_tree.py +++ b/aospdtgen/device_tree.py @@ -102,7 +102,7 @@ def dump_to_folder(self, folder: Path): # Proprietary files list (folder / "proprietary-files.txt").write_text( - self.proprietary_files_list.get_formatted_list(self.device_info.build_description)) + self.proprietary_files_list.get_formatted_list(self.device_info.build_description), encoding="utf-8") # Dump build props for partition in self.partitions.get_all_partitions(): @@ -135,10 +135,10 @@ def dump_to_folder(self, folder: Path): for file in self.rootdir_etc_files + self.rootdir_recovery_etc_files: (rootdir_etc_path / file.name).write_bytes(file.read_bytes()) - (rootdir_etc_path / self.fstab.fstab.name).write_text(self.fstab.format()) + (rootdir_etc_path / self.fstab.fstab.name).write_text(self.fstab.format(), encoding="utf-8") # Manifest - (folder / "manifest.xml").write_text(str(self.vendor.manifest)) + (folder / "manifest.xml").write_text(str(self.vendor.manifest), encoding="utf-8") def cleanup(self) -> None: """ diff --git a/aospdtgen/utils/format_props.py b/aospdtgen/utils/format_props.py index 99b3602..4897801 100644 --- a/aospdtgen/utils/format_props.py +++ b/aospdtgen/utils/format_props.py @@ -45,7 +45,7 @@ def dump_partition_build_prop(build_prop: BuildProp, destination_file_path: Path section_to_props["Miscellaneous"] = filtered_build_props # Write the properties to the file - with destination_file_path.open("w") as f: + with destination_file_path.open("w", encoding="utf-8") as f: for section, props in section_to_props.items(): f.write(f"# {section}\n") for prop in sorted(props.keys()):