Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What advantage is there to using UTF-8 over UTF-16? [duplicate]

Possible Duplicate:
UTF8, UTF16, and UTF32

I am always reading things saying to write my source code in UTF-8 and stay way from other encodings, but it also seems like UTF-16 is an improved version of UTF-8. What is the difference between them, and is there any advantage to either one?

like image 573
Orcris Avatar asked Mar 07 '12 00:03

Orcris


1 Answers

This should help :)

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

Summary:

  1. UTF-8 and UTF-16 are both used for encoding characters
  2. UTF-8 uses a byte at the minimum in encoding the characters while UTF-16 uses two
  3. A UTF-8 encoded file tends to be smaller than a UTF-16 encoded file
  4. UTF-8 is compatible with ASCII while UTF-16 is incompatible with ASCII
  5. UTF-8 is byte oriented while UTF-16 is not
  6. UTF-8 is better in recovering from errors compared to UTF-16
like image 86
Michael Avatar answered Sep 19 '22 21:09

Michael