From 2df2cc0dab68947e367b1ac6f367762626055d7b Mon Sep 17 00:00:00 2001 From: wangxingda Date: Fri, 5 Apr 2024 19:37:53 +0800 Subject: [PATCH] add default subtitle encoding to utf-8 --- app/services/voice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/voice.py b/app/services/voice.py index 220a4e5..50dae07 100644 --- a/app/services/voice.py +++ b/app/services/voice.py @@ -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: file.write("\n".join(sub_items) + "\n") 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]) logger.info(f"completed, subtitle file created: {subtitle_file}, duration: {duration}") except Exception as e: