TTS icon indicating copy to clipboard operation
TTS copied to clipboard

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 3096

Open GuntaButya opened this issue 5 years ago • 3 comments

Using: Miniconda, separate env - Install was successful. Using Tree: https://github.com/mozilla/TTS/tree/4873601 Model Files: https://drive.google.com/drive/folders/1wGpFgHBHahgCgUrmjxpjK80Reb1Uh5V_

On running the code, I get error:

\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 3096: character maps to <undefined>

Any Idea what is wrong here, I have spend so long on this trying to get it working.

GuntaButya avatar Dec 22 '20 20:12 GuntaButya

I have used:

in the : "Lib\site-packages\TTS-0.0.5-py3.6-win-amd64.egg\TTS\utils\io.py" line 33 and adding errors='ignore'

with open(config_path, 'r', errors='ignore') as f:

to get around the problem, a totally not suitable solution! I would really like to know what's causing this, and to solve this problem properly!

GuntaButya avatar Dec 22 '20 22:12 GuntaButya

Could you try this? https://github.com/mozilla/TTS/issues/454#issue-655423192

lexkoro avatar Dec 23 '20 05:12 lexkoro

Thank You to @SanjaESC

It has resolved the issue, adding the parameter:

encoding = "utf-8"

to line: 27 in Lib/site-packages/TTS-0.0.6-py3.6-win-amd64.egg/TTS/utils/io.py, like this:

with open(config_path, "r", encoding = "utf-8") as f:

Has solved the problem in all tested situations. Please note, I have only tested 2 situations and not all the situations I had seen this error occur.

I hope this helps others!

GuntaButya avatar Dec 25 '20 00:12 GuntaButya