Skip to content

Commit 18107a1

Browse files
committed
Enforce UTF-8 encoding when opening meta files
Certain characters in certain mod descriptions resolve to undefined characters with some default system encodings, which would cause the program to throw a decode error when encountering these. Forcing UTF-8 stops this from occuring.
1 parent 31b3a57 commit 18107a1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mo2-unignore-updates/list-ignored.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
file_data: str
2525
changed_file_data: str
2626
try:
27-
with open('meta.ini', "r") as read_file:
27+
with open('meta.ini', "r", encoding='UTF-8') as read_file:
2828
file_data = read_file.read()
2929
changed_file_data = sub(ignored_regex, 'ignoredVersion=', file_data)
3030
except FileNotFoundError:

mo2-unignore-updates/unignore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
file_data: str
2525
changed_file_data: str
2626
try:
27-
with open('meta.ini', "r") as read_file:
27+
with open('meta.ini', "r", encoding='UTF-8') as read_file:
2828
file_data = read_file.read()
2929
changed_file_data = sub(ignored_regex, 'ignoredVersion=', file_data)
3030
except FileNotFoundError:

0 commit comments

Comments
 (0)