python之路day1

字符编码

ASICC  一个字符占8位(1byte)

unicode(统一码,万国码,单一码) 不管是中文还是英文,一个字符占16位(2bytes)

utf-8  所有的英文字符都是按ASICC码来存;中文按utf-8来存(需要3bytes)

ASICC     255    1bytes

       -----1980    gb2312  7xxx

       ----1995    GBK1.0  2W+

        ----2000    GB18030    17xxx

          ----unicode  2bytes

            ----utf-8    en:1bytes;  中文:3bytes

原文地址:https://www.cnblogs.com/huangtiandi001/p/6972670.html