Python 编码问题

CSDN:

http://blog.csdn.net/weixin_38206454/article/details/78378939


简而言之,Python 2.x里字符串有两种:str和Unicode

前者到后者要decode,后者到前者要encode,’utf-8’为例:

str.decode(‘utf-8’) -> Unicode

str <- Unicode.encode(‘utf-8’)

http://blog.csdn.net/trochiluses/article/details/16825269

encode & decode

http://professor.blog.51cto.com/996189/1655816

python 字符编码详解

http://www.cnblogs.com/huxi/archive/2010/12/05/1897271.html

eval()函数

http://www.runoob.com/python/python-func-eval.html

你可能感兴趣的:(Python 编码问题)