Python 编码与解码:
1.0 解码:encoding = 'utf-8/utf8/UTF-8/UTF8',要想解码,必须知道用什么方式编码的。
with open('test','r',encoding = 'utf-8') as e: print(e.read())
2.0 Python 2 存的是bytes与unicode数据类型,Python 3 是str unicode
with open('test','r',encoding = 'utf-8') as e: print(e.read())
2.0 Python 2 存的是bytes与unicode数据类型,Python 3 是str unicode
转载于:https://www.cnblogs.com/rollost/p/10960987.html