Do not use platform default encoding when generating subtitles

Windows uses cp1252, but we need UTF8. Specify it explicitly.
This commit is contained in:
Matt Penny 2024-01-08 22:42:05 -05:00
parent 6f1834f742
commit 725afb48c8

View File

@ -108,7 +108,7 @@ def dump_lines(sourcefile_path, lines):
if not os.path.exists(os.path.dirname(os.path.abspath(sourcefile_path))):
os.makedirs(os.path.dirname(os.path.abspath(sourcefile_path)))
with open(sourcefile_path, "w") as f:
with open(sourcefile_path, "w", encoding="utf-8") as f:
f.writelines(lines)
def get_caption_keys_values_language(lines):