Answer the question
In order to leave comments, you need to log in
How to convert characters from UTF-8 to \320\220 format?
I'm trying to solve a string encoding puzzle.
Required from line:
Administrator
Get:
\320\220\320\264\320\274\320\270\320\275\320\270\321\201\321\202\321\200\320\260\321\ 202\320\276\321\200
i.e.
A = \320\220
d = \320\264
m = \320\274
u = \320\270
n = \320\275
u = \320\270
c = \321\201
t = \321\202
p = \321\200
a = \320\260
m = \321\202
o = \320\276 p = \
321
\200
Source string in UTF-8
Answer the question
In order to leave comments, you need to log in
print ''.join(['\\'+oct(ord(c))[1:] for c in u'Администратор'.encode('utf-8')])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question