Python Unicode string stored as '\u84b8\u6c7d\u5730' in file, how to convert it back to Unicode?

前端 未结 1 1342
予麋鹿
予麋鹿 2020-12-03 10:56

Some Unicode data is stored in file as \'\\u84b8\\u6c7d\\u5730\' without any encoding.

Is there a way to covert them back in Python?

相关标签:
1条回答
  • 2020-12-03 11:28
    >>> print '\u84b8\u6c7d\u5730'.decode('unicode-escape')
    蒸汽地
    
    0 讨论(0)
提交回复
热议问题