SMZ3: fix loading TextScript on systems that don't default to something utf-8 compatible (#384)

This commit is contained in:
Fabian Dill
2022-04-01 07:14:20 +02:00
committed by GitHub
parent fe4a26d034
commit 931bf7da16

View File

@@ -17,7 +17,7 @@ class Texts:
@staticmethod @staticmethod
def ParseTextScript(resource: str): def ParseTextScript(resource: str):
with open(resource, 'r') as file: with open(resource, 'r', encoding="utf-8-sig") as file:
return [text.rstrip('\n') for text in file.read().replace("\r", "").split("---\n") if text] return [text.rstrip('\n') for text in file.read().replace("\r", "").split("---\n") if text]
scripts: Any = ParseYamlScripts.__func__(text_folder + "/Scripts/General.yaml") scripts: Any = ParseYamlScripts.__func__(text_folder + "/Scripts/General.yaml")