Bit (bit), byte (byte), character, encoding meaning relationship

Table of contents

One, bit

Two, bytes

3. Characters

4. Character set

5. Coding


One, bit

        The smallest unit of data storage. Each binary digit 0 or 1 is 1 bit.

Two, bytes

        8 bits constitute a byte; that is: 1 byte (byte) = 8 bit (bit);

        1 KB = 1024 B (bytes);

        1 MB = 1024 KB; (2^10 B);

        1 GB = 1024 MB; (2^20 B);

        1 TB = 1024 GB; (2^30 B)。

3. Characters

        a, A, 中, +, *, の... all represent a character;

        Under general utf-8 encoding, a Chinese character occupies 3 bytes;

        Generally, under utf-8 encoding, a Chinese character occupies 3 bytes.

4. Character set

        That is, a collection of various characters, that is to say which Chinese characters, letters (A, b, c) and symbols (spaces, quotation marks..) will be included in the standard.

5. Coding

        It is stipulated that each "character" is stored in one byte or multiple bytes, and which bytes are used for storage. This regulation is called "encoding". (It actually encodes the characters in the character set, that is: each character is stored in binary in calculation);

        In layman's terms: encoding is to translate characters into corresponding binary numbers according to the rules, run and store them in the calculator, and when users read them (such as browsers), they can understand them after parsing them with the corresponding encoding.

Guess you like

Origin blog.csdn.net/m0_60252632/article/details/123335426