Nothing to learn about Python, when you see the Python character type, there is a reference to the character set, the problem of the character set I've never figured out, what's the difference between ASCII, Unicode, UTF-8? By this opportunity finally is a little bit of understanding, record, study.
people who talk about character sets, must be dealing with computers, because computers can only deal with numbers, there is no human such ultra-high intelligence, if the computer needs to process text, Then you have to convert the text into numbers. So here's the question: How do you translate the text into numbers? The smart man thought of the character set. The oldest computer was designed with 8 bits (bit) as a byte (byte), which means 8 bits a byte. Therefore, a word energy-saving representation of the largest integer is 255 (28 -1, binary number 1111 1111 = decimal 255), if you want to represent a larger number, you must take more bytes, such as two bytes representing the largest integer is 65535 (216 -1).
Since the computer was born in the United States, it was initially encoded into a computer with uppercase and lowercase letters, numbers, and some symbols ASCII编码
, such as the code for capital A is 65, and the lower case z is encoded as 122. The following is an ASCII encoding table, ^_^:
Original address: Read more >>
Inextricably linked character set ASCII, Unicode, UTF-8----If you're confused, come on.