JS character encoding ---- ASCII, Unicode and UTF-8

Turn: http: //www.ruanyifeng.com/blog/2007/10/ascii_unicode_and_utf-8.html

1.ASCII code

A 7-bit binary number (remaining a binary 0) to represent all the uppercase and lowercase letters, numbers 0-9, punctuation, and special control characters used in American English.

The last bit for parity.

2.Unicode

Unicode byte can represent all of the world, the most commonly used Unicode is a character with two bytes (If you want to very remote character, you need 4 bytes)

 
utf8 unicode character set is encoded using the encoding of

ASCII code is a byte, and Unicode encoding is usually 2 bytes .

3.GBK

GBK only used to encode characters, GBK full name "Chinese Internal Code Specification", uses double-byte coding.

4. charset/encoding

  Charset (Character set) characters: a collection of abstract representation of the character. Including the world's various languages, in line and characters. ie unicode

  Encoding (Charset Encoding) character encoding: establishing a set of rules and the character corresponding to the computer system. It is simply,

  Characters into computer recognizable regular binary code. ie utf-8

Guess you like

Origin www.cnblogs.com/ljyqd/p/11096800.html