Python3中有两种格式: str:str>>bytes 称为编码(encode)方法有1.re=bytes(“ccc”,“utf8”)2.re=“ccc”.encode(“utf8”)py3中str都是Unicode编码。兼容utf8,三字节表示中文。 bytes:bytes>>str称为解码( Read More
posted @ 2016-10-11 12:31 gege4105 Views(176) Comments(0) Diggs(0)
from http://www.cnblogs.com/yuanchenqi/articles/5938733.html Py 编码的真相 今天让我们一起彻底揭开py编码的真相,包括py2和py3。有同学可能问:以后py3是大势所趋,还有必要了解py2那令人头疼的编码吗?答案是太有必要啦。py2在生 Read More
posted @ 2016-10-11 12:30 gege4105 Views(164) Comments(0) Diggs(0)