Python Unicode string stored as ‘u84b8u6c7du5730’ in file, how to convert it back to Unicode?

Posted on

Question :

Python Unicode string stored as ‘u84b8u6c7du5730’ in file, how to convert it back to Unicode?

Some Unicode data is stored in file as ‘u84b8u6c7du5730’ without any encoding.

Is there a way to covert them back in Python?

Asked By: lucemia

||

Answer #1:

>>> print 'u84b8u6c7du5730'.decode('unicode-escape')
???

Leave a Reply

Your email address will not be published. Required fields are marked *