UTF: Unicode/UCOS Transformation Format
UTF-8, 8bit encoding, ASCII do not change, other characters do Variable Length Encoding, each character 1-3 byte. Usually used as an external code. has the following advantages:
* It is irrelevant to the CPU byte sequence and can communicate with each other on different platforms.
* High Fault Tolerance. If any one byte is damaged, only one encoding bit will be lost at most, and no chainlock error will occur (for example, if one byte is incorrect, the entire line will be garbled)
UTF-16, 16-bit encoding, is a variable length code, roughly equivalent to 20-bit encoding, the value between 0 and 0x10ffff, basically is the implementation of Unicode encoding. it is a variable length code, which is related to the CPU order, but because it saves the most space, it is often used as an external code for network transmission.
The UTF-16 is Unicode preferred encoding.
UTF-32, uses only 32-bit encoding in the Unicode range (0 to 0x10ffff), equivalent to a subset of the UCS-4.
UTF and UNICODE:
Unicode is a character set and can be viewed as an internal code.
UTF is a encoding method because Unicode is not suitable for direct transmission and processing in some scenarios. UTF-16 is Unicode encoding directly, no transformation, but it contains 0x00 in the encoding, the first byte of the first 256 bytecode is 0x00, in the operating system (C language) it has special significance and may cause problems. using UTF-8 encoding to convert Unicode directly can avoid this problem and bring some advantages.
Chinese national standard code:
GB 13000: equivalent to ISO 10646-1/Unicode 2.1. It will be changed in the future along with the standard changes of ISO 10646/Unicode.
GBK: Extended gb2312 to accommodate the unified Chinese Character section of Unicode 2.1 outside the gb2312 Character Set range, and added some characters not included in Unicode.
GB 18030-2000: Based on GB 13000, as an extended version of Unicode 3.0 GBK, covering all unicode encoding, equivalent to UTF-8, UTF-16, is a form of Unicode encoding. variable-length encoding, which is a single-byte, dual-byte, or 4-byte character encoding. gb18030 is backward compatible with gb2312/GBK.
GB 18030 is mandatory for all non-handheld/Embedded Computer Systems in China.
Unicode and ASCII code
In layman's terms,
The ascll codes are all English letters and some special symbols (tabs and so on ),
Unicode contains not only English and special symbols, but also Japanese, Korean, and Chinese ......
Unicode