ASCII encoding:
The computer was invented by the Americans, so the string has only numbers, English letters and special characters, a total of 127 characters are encoded in the computer, this encoding table is called ASCII encoding. This encoding stores characters using only one byte, or 8bit.
Unicode (Universal code, unified Encoding):
But to store the world's characters 1byte is definitely not enough. At this time the Unicode encoding came into being, most commonly used to represent a character in 2byte.
UTF-8 Code:
Using Unicode solves the problem of garbled characters, but if the text is in English, the storage is too wasteful and bandwidth is wasted while it is being transmitted. So in order to solve this problem, UTF-8 coding came into being. The way to do this is to convert the Unicode encoding into UTF-8 encoding. English occupies 1byte, Chinese characters occupy 3byte, very uncommon words only use 4-6byte. The ASCII code can actually be seen as part of the UTF-8.
Python string and encoding