Character Set and encoding

Source: Internet
Author: User
Tags control characters printable characters

Character Set

    • ASCII character set
      Amerrican stadard code for information interchange is abbreviated as ISO/IEC 646.
      ASCII is stored in seven bits (7-bit, 0-127) and is a single-byte encoding system. The hexadecimal format is 0-7f. For example, 0x21 is !, 0x7d Yes} and so on.
      ASCII includes uppercase and lowercase letters, numbers, punctuation marks, and some special operators, including 33 control characters and 95 printable characters.

 

    • ANSI character set
      Different countries and regions have developed different standards, resulting in gb2312, big5, JIS, and other compilation standards. These two bytes are used to represent the extended Chinese character encoding methods of a single character. They are called ANSI encoding. In a simplified Chinese system, ANSI encoding represents gb2312 encoding. In a Japanese operating system, ANSI encoding represents JIS encoding.

 

    • Unicode Character Set
      Developed by international organizations, each character in a variety of languages is a unified and unique mathematical number.

Character encoding

    • The ISO-8859-1 is a single-byte encoding rule.
      Encoding method: convert any character in the ASCII character set into a byte for storage.

 

    • Gb2312, big5, shift_jis, ISO-8859-2 is ANSI encoded.
      Encoding method: each character is represented by one or more bytes. Assume that there is a string of "Chinese 123". When the ANSI character set is used, the "Chinese" characters are stored in two bytes, and the "123" character sets are saved in one byte.

    • Unicode Character Set has a variety of encoding methods: Unicode, UTF-8, UTF-16, UTF-32, unicodelittle, unicodebig and so on.
      Encoding method (UNICODE ):Each character is encoded in 2 bytes.
      Encoding method (UTF-8 ):Use1 to 6 bytesEncode each character. 128 ASCII characters require only one byte encoding; If Unicode characters are represented by two bytes, it is likely to require three bytes to be encoded into a UTF-8, And if Unicode characters are represented by four bytes, encoding into a UTF-8 may take 6 bytes.
      Encoding method (UTF-16 ):Each character is encoded in 2 to 4 bytes. If the character encoding U is less than 0x10000, that is, within 0 to 65535 in decimal format, it is expressed in two bytes. If the character encoding U is greater than 0 x, It is encoded in four bytes. The advantage of UTF-16 over UTF-8 is that most characters are stored in fixed-length bytes (2 bytes,But UTF-16 is not compatible with ASCII code.
      Encoding method (UTF-32 ):Each character is encoded in 4 bytes.

 

Refer:
Http://www.regexlab.com/zh/encoding.htm
Http://zh.wikipedia.org/w/index.php? Title = Unicode & variant = ZH-CN
Http://en.wikipedia.org/wiki/UTF-8
Http://zh.wikipedia.org/w/index.php? Title = UTF-16 & variant = ZH-Hans
Http://zh.wikipedia.org/w/index.php? Title = UTF-32 & variant = ZH-CN

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.