-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
force use utf-8 open README.md #76
Comments
and here, "non-utf-8" codec error raceback (most recent call last):
File "autosub/main.py", line 170, in <module>
main()
File "autosub/main.py", line 161, in main
ds_process_audio(ds, audio_segment_path, output_file_handle_dict, split_duration=args.split_duration)
File "autosub/main.py", line 69, in ds_process_audio
write_to_file(output_file_handle_dict, split_inferred_text, line_count, split_limits, cues)
File "C:\env\python-venv\deepspeech\lib\site-packages\autosub\writeToFile.py", line 43, in write_to_file
file_handle.write(inferred_text + "\n\n")
UnicodeEncodeError: 'gbk' codec can't encode character '\udce9' in position 0: illegal multibyte sequence —————————— raceback (most recent call last):
File "autosub/main.py", line 170, in <module>
main()
File "autosub/main.py", line 161, in main
ds_process_audio(ds, audio_segment_path, output_file_handle_dict, split_duration=args.split_duration)
File "autosub/main.py", line 69, in ds_process_audio
write_to_file(output_file_handle_dict, split_inferred_text, line_count, split_limits, cues)
File "C:\env\python-venv\deepspeech\lib\site-packages\autosub\writeToFile.py", line 43, in write_to_file
file_handle.write(inferred_text + "\n\n")
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-262: surrogates not allowed |
Weird. Which language is your audio in? |
mandarin, I found many people have the same problem in python. |
Aah yes. You'll need to add |
thk, it worked. AutoSub/autosub/writeToFile.py Line 43 in 5dc2314
file_handle.write(inferred_text.decode('utf-8', 'ignore').encode('utf-8') + "\n\n") Line 140 in 5dc2314
output_file_handle_dict[format] = open(output_filename, "w", encoding='utf-8', errors='surrogateescape') |
Otherwise encounter error
The text was updated successfully, but these errors were encountered: