Character encoding and other records

Source: Internet
Author: User

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

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.