Learn about character encoding:
A computer uses a numerical code to represent each character and specifies a unique numerical code for each character. These tables are called encoding tables that specify the code used by each character. Encoding is a numerical number of characters used in daily life.
1: The first table: ASCII table
Use (number 0 ~ 127) represents the commonly used 128 characters, using 7-bit binary
The most commonly used Chinese encoding table GB2312 contains many characters, and a single byte (128 characters) cannot meet Chinese requirements. Therefore, GB2312 uses two bytes to represent a Chinese character.
UNICODE encoding requires that all characters are represented in two bytes. However, there are still a lot of software, and hardware uses single-byte encoding. Use and have a new encoding UTF-8
UTF-8: Unicode Transformation Format-8bit that allows BOM inclusion, but typically does not. It is a multi-byte encoding for international characters. It uses 8 bits (one byte) for English and 24 bits (three bytes) for Chinese characters. UTF-8 contains all the characters needed by all countries in the world, is an international code, universal. UTF-8-encoded text can be displayed on browsers that support UTF8 character sets in countries. For example, if it is UTF-8 encoded, Chinese characters can also be displayed on Internet Explorer of foreigners. They do not need to download the Chinese language support package for Internet Explorer.
Both GBK and GB2312 must be encoded with Unicode before conversion.
In my understanding, Unicode is dubyte. In non-Unicode, English is a single byte and Chinese is dubyte.
VarChar () storage Non-Unicode data NvarChar () Storage Unicode data occupies twice the space of the former
'"X' Escape Character" x is in hexadecimal notation and the ASCII code is output.
'"U' Escape Character" x with 4-digit hexadecimal format, output Unicode code
For example, the ASCII code of lowercase letter a is 97 (The hexadecimal value of 97 is 61)
Response. Write (char) 97), Response. Write ('"x61'), and Response. Write ('" u0061') can both output the letter.
0 xFFFF: 0x hexadecimal flag