UTF-8 与 UTF-16 的区别

http://www.differencebetween.net/technology/difference-between-utf-8-and-utf-16/


They only differ in how many bytes they use to encode each character. Since both are variable width encoding, they can use up to four bytes to encode the data but when it comes to the minimum, UTF-8 only uses 1 byte (8bits) and UTF-16 uses 2 bytes(16bits).

都是可变长编码;最多用4字节;UTF-8 至少用1字节,UTF-16 至少用2字节。

The main advantage of UTF-8 is that it is backwards compatible with ASCII.

UTF-8 与 ASCII 的兼容比较好。


小结:

1. UTF-8 uses a byte at the minimum in encoding the characters while UTF-16 uses two
2. A UTF-8 encoded file tends to be smaller than a UTF-16 encoded file
3. UTF-8 is compatible with ASCII while UTF-16 is incompatible with ASCII

Read more: Difference Between UTF-8 and UTF-16 | Difference Between | UTF-8 vs UTF-16 http://www.differencebetween.net/technology/difference-between-utf-8-and-utf-16/#ixzz1uvOSpFFG

你可能感兴趣的:(UTF-8 与 UTF-16 的区别)