码迷,mamicode.com
首页 > 编程语言 > 详细

编码部分历史及python文件编码简介

时间:2018-04-13 17:50:42      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:python 编码

    UTF-8 = unicode的扩展集,可变长的字符编码集

    

    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文件编码简介

标签:python 编码

原文地址:http://blog.51cto.com/13467494/2103105

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!