ascii --> gb2312 --> gbk1.0 -->gb18030
ascii --> unicode --> utf-8
Python2.x == ascii是其默认编码
如果在2.x中需要使用utf-8,需要以下声明:
#!-*- coding:utf-8 -*-
#coding:utf-8
Python3.x == unicode是其默认编码
unicode是向下兼容gb2312和gbk
编码部分历史及python文件编码简介
原文:http://blog.51cto.com/13467494/2103105