I'm trying to convert a str string '\u4e2d\u56fd'
to unicode u'\u4e2d\u56fd'
. It's the same thing in python3, but how to do it in python2.7?
I have tried decode, encode, str, bytes, unicode and others, but they all didn't work.
a = '\u4e2d\u56fd'
b = u'\u4e2d\u56fd'
print a
print b
And the result of the code above is
\u4e2d\u56fd
中国
All I want to do is to convert a to b.
Thanks for any tip!