diff --git a/whisper/transcribe.py b/whisper/transcribe.py index a795f73be..0ee42a8fb 100644 --- a/whisper/transcribe.py +++ b/whisper/transcribe.py @@ -289,11 +289,11 @@ def cli(): audio_basename = os.path.basename(audio_path) # save TXT - with open(os.path.join(output_dir, audio_basename + ".txt"), "w") as txt: + with open(os.path.join(output_dir, audio_basename + ".txt"), "w", encoding="utf-8") as txt: print(result["text"], file=txt) # save VTT - with open(os.path.join(output_dir, audio_basename + ".vtt"), "w") as vtt: + with open(os.path.join(output_dir, audio_basename + ".vtt"), "w", encoding="utf-8") as vtt: write_vtt(result["segments"], file=vtt)