"\u043E\u0431\u0449\u0435\u0441\u0442\u0432\u043E"?" />
V
V
vrtlpilot2019-04-13 22:48:28
Python
vrtlpilot, 2019-04-13 22:48:28

Python. How to convert a string to unicode? "society"->"\u043E\u0431\u0449\u0435\u0441\u0442\u0432\u043E"?

What's the point. You need to read lines from the file and prepare them for transmission to the server in the specified format.
for example, read "society" in the request to the server insert \u043E\u0431\u0449\u0435\u0441\u0442\u0432\u043E
Tried encode('utf-8'), encode('utf-16'), unicode and bytes. Every time something is nearby, but additional processing is required. Can eat all the same any standard means?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-04-14
@vrtlpilot

'общество'.encode('unicode_escape')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question