Add explicit encoding on manage_languages.py for windows users

This commit is contained in:
AnimeGitB 2022-07-27 20:32:44 +09:30 committed by Melledy
parent b80126fdda
commit 0e406d9f05
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ def ppprint(data):
class JsonHelpers:
@staticmethod
def load(filename: str) -> dict:
with open(filename, 'r') as file:
with open(filename, 'r', encoding='utf-8') as file:
return json.load(file)
@staticmethod
@ -117,7 +117,7 @@ class LanguageManager:
for file in files:
if file.rpartition('.')[-1] in SOURCE_EXTENSIONS:
filename = os.path.join(root, file)
with open(filename, 'r') as f:
with open(filename, 'r', encoding='utf-8') as f:
data = f.read() # Loads in entire file at once
for k in self.TRANSLATION_KEY.findall(data):
used.add(k)