M
M
melancholia3122021-03-21 15:24:57
Python
melancholia312, 2021-03-21 15:24:57

Can't handle error 'utf-8' codec can't decode byte 0xfb in position 10: invalid start byte?

Faced such a problem. When running my bot in PyCharm, there were no problems, but when I decided to transfer the bot to the PythonAnywhere host, this error was displayed -

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 10: invalid start byte.

The only variable where I use decode is
menu_keyboard = json.dumps(menu_keyboard, ensure_ascii=False).encode('utf-8')
menu_keyboard = str(menu_keyboard.decode('utf-8'))

I do not know what to do...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2021-05-23
@2ord

There is a suspicion of a difference in Python 2/3. Check that the same version is being used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question