1, first met coding
An English ASCII, 8 (1 byte) indicates a thing, 2 ** 8
Unicode two Unicode, 32 (4 bytes) Represents a thing, 2 ** 32
Three utf-8, a Unicode compression, as few digits represent a thing, to 8-bit units
A minimum of one byte, Chinese up to 4 bytes: 3 bytes = 24 represents
Four gdk support Chinese
2, python encoding interpreter
py2: ASCII, To support py3 added to the header file:
# -- coding:utf-8 --
print ( 'Hello')
py3: utf-8
3, file encoding
Saved recommended when using utf-8 save
4, bit (bit):
Is a minimum unit of data stored inside the computer, is an eight-bit binary number 11001100.
5, bytes (byte):
It is the basic unit of computer data processing, denoted by capital B Traditionally, 1B (byte, byte) = 8bit (bits)
6 characters:
It refers to letters, numbers, and symbols used in computers
ASCIIS code: 1 letters (case insensitive) = 1 byte space
Chinese characters 1 = 2 bytes of space
A one byte ASCII code =
UTF-8 encoding: an English one byte characters =
English punctuation = 1 byte
A Chinese (Traditional including) = 3 bytes
Chinese punctuation 3 bytes =
Unicode encoding: 1 = 2 bytes English characters
English punctuation 2 bytes =
A Chinese (Traditional including) 2 bytes =
Chinese punctuation 2 bytes =