M
M
Mark Adams2016-10-07 01:06:41
Python
Mark Adams, 2016-10-07 01:06:41

How to convert str ascii to normal string (Python)?

Hello everyone from Python 3 (lthmvj!).
There is a line:

s = '\\u2800\\u2800\\u2800\\u2800\\n\\u041a\\u0410\\u041b\\u0415\\u041d\\u0414\\u0410\\u0420\\u042c'

How to convert it to normal?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2016-10-07
@Ba1t

# Python 3
bytes(s, 'ascii').decode('unicode-escape')
# Python 2
s.decode('unicode-escape')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question