Answer the question
In order to leave comments, you need to log in
How to solve encoding problem in pycharm?
Suddenly this error appeared
SyntaxError: Non-UTF-8 code starting with '\xf3' in file C:\PROJECTS\KURSOVAI\utils.py on line 25, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details.
words = ['улика', 'улика1']
if 'улика' in words:
print(1)
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf3 in position 0: invalid continuation byte
Answer the question
In order to leave comments, you need to log in
This is not a problem with PyCharm, but with Python... Most likely Python 2.7
Write at the beginning of the python script:
# coding=utf-8
Or format UNICOD strings like this:
words = [u'улика', u'улика1']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question