Answer the question
In order to leave comments, you need to log in
How to decode UTF-8?
I save letters in a folder. The letters contain the Cyrillic alphabet, and some of them are badly coded as a result. For example, a fragment of a saved letter
<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c,</p>
Answer the question
In order to leave comments, you need to log in
>>> s = "<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c,</p>"
>>> x = s.encode('utf-8')
>>> x.decode('utf-8')
'<p>Добрый день,</p>'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question