Python3 character encoding in the end is what ghost

First of all Americans ASCII code is used for ourselves, only for English and a series of symbols, they imagine reserved for encoding position, only to have a country in the East too complex characters, set aside not enough, so the power to re-engage in a coding gb2312, gbk, etc. the result is that countries around the world are engaged in their own, once transnational went wrong, so there are international organizations staged a Unicode, is to engage in a transcoding platform, both when I use this platform to exchange national turn up into relevant codes, I will give you transcoding service, but however, this thing is for Western countries, this thing up too much space it, because ASCII code too simple not take me more than this country great space to store characters, so they staged a UTF-8 would like to achieve long is long, think short is short can adapt, on-demand space, alternate Unicode.

Python3 current default encoding is UTF-8, Python2, this high degree of UTF-8 has not been raised to the level of the platform, it is a subset of, perhaps the first decoded into unicode, but in Python3, the increased level of direct replacement Unicode became emperor, Unicode take a back seat.

Realize that encode () and decode character transcoding use (), the former brackets turn into what you want to write code, which is converted to utf-8, you have to write what you are now parentheses yards, on this point thing! !

Guess you like

Origin www.cnblogs.com/on2road/p/12027997.html