srt-gpt-translator icon indicating copy to clipboard operation
srt-gpt-translator copied to clipboard

UnicodeEncodeError

Open dlxmax opened this issue 2 years ago • 1 comments

Tried to translate to Korean. It failed.

  0%|          | 0/77 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "C:\Users\Max\desktop\srt-gpt-translator\srt_translation.py", line 192, in <module>
    print((short_text))
  File "C:\Python311\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 0: character maps to <undefined>

dlxmax avatar Sep 01 '23 06:09 dlxmax

Same issue here, I found a manual way to fix this...

Open the file with "notepad" and go to "File -> Save As", change the Codification to UTF-8.

But in my case the script gets freeze (maybe because i've reached the limit on chatgpt)

ProtocolNebula avatar Sep 14 '23 10:09 ProtocolNebula