python utf-8 转码问题

print str('345207235346266265346237217').decode('string_escape')
凝涵柏

但该语句在python3中无法运行

File "script.py", line 3
print str('345207235346266265346237217').decode('string_escape')
^
SyntaxError: invalid syntax

Exited with error status 1

解决办法:

print (str('345207235346266265346237217').encode('latin1').decode('unicode-escape').encode('latin1').decode('utf-8'))

凝涵柏

step by step.
原文地址:https://www.cnblogs.com/answer727/p/14013455.html