from: https://stackoverflow.com/questions/44742806/how-to-remove-escape-characters-escaping-unicode-chars-from-unicode-string-in

>>> test1 = u'"Hello," he\u200b said\u200f\u200e.\n\t"I\u200b am\u200b nine years old\xe2"'
>>> test2 = '"Hello," he\\u200b said\\u200f\\u200e.\n\t"I\\u200b am\\u200b nine years old"'
>>> test2.decode('unicode-escape')
u'"Hello," he\u200b said\u200f\u200e.\n\t"I\u200b am\u200b nine years old"'
>>> print test2.decode('unicode-escape')
"Hello," he​ said‏‎.
    "I​ am​ nine years old"

 

posted on 2019-07-05 18:54  Go_Forward  阅读(580)  评论(0编辑  收藏  举报