L
L
Lorri2021-08-09 21:51:47
PyCharm
Lorri, 2021-08-09 21:51:47

Non-UTF-8 error in PyCharm, what to do about it?

When I run the code, I get the error Non-UTF-8 code starting with '\xd0', what should I do about it? Explain, please, in more detail, because. I'm quite new and don't understand what coding is, all these types etc. (photo of error and code below)
6111789725061389953340.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-08-09
@Lorri_i

Your source code is not typed in UTF-8 encoding, or Python did not understand what it is typed in.
a) See what encoding is selected in the Pycharm settings.
b) Add a line to the beginning of the file indicating the encoding, for example
# -*- coding: utf-8 -*-
if the file is still in utf-8 or
# -*- coding: windows-1251 -*-
if the file is typed in Windows default encoding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question