Specify the encoding as UTF-8 when opening the MFC dictionary file in the Python script.

This commit is contained in:
siowu 2024-09-03 02:43:04 +08:00
commit 08fd383713

View file

@ -142,7 +142,7 @@ for sec in range(NUM_SECTORS):
if os.path.isfile(DICT_DEF_PATH):
print(f"Loading {DICT_DEF}")
with open(DICT_DEF_PATH, 'r') as file:
with open(DICT_DEF_PATH, 'r', encoding='utf-8') as file:
for line in file:
if line[0] != '#' and len(line) >= 12:
DEFAULT_KEYS.add(line[:12])