Merge pull request #174 from wangxingda/fix_encoding_bug
add default subtitle encoding to utf-8
This commit is contained in:
@@ -1102,7 +1102,7 @@ def create_subtitle(sub_maker: submaker.SubMaker, text: str, subtitle_file: str)
|
|||||||
with open(subtitle_file, "w", encoding="utf-8") as file:
|
with open(subtitle_file, "w", encoding="utf-8") as file:
|
||||||
file.write("\n".join(sub_items) + "\n")
|
file.write("\n".join(sub_items) + "\n")
|
||||||
try:
|
try:
|
||||||
sbs = subtitles.file_to_subtitles(subtitle_file)
|
sbs = subtitles.file_to_subtitles(subtitle_file, encoding="utf-8")
|
||||||
duration = max([tb for ((ta, tb), txt) in sbs])
|
duration = max([tb for ((ta, tb), txt) in sbs])
|
||||||
logger.info(f"completed, subtitle file created: {subtitle_file}, duration: {duration}")
|
logger.info(f"completed, subtitle file created: {subtitle_file}, duration: {duration}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user