Original address: Click to open the link
See a blog post on the home page today-simply talk about Unicode and UTF-8, and learn that UTF-8 is a way to implement Unicode:
Unicode only provides a uniform binary number for each character in the world, and does not specify how the program should be stored and parsed.
It can be said that UTF-8 is one of the Unicode implementations ...
When this harvest is recorded in Flash memory, @ Asuka _asuka a good question in the reply: "Why are Unicode and UTF8 the two options when choosing the encoding method?" ”
In C #, System.Text.Encoding.Unicode and System.Text.Encoding.UTF8 are 2 ways to encode each other. If UTF-8 is an implementation of Unicode, why is encoding.unicode used as a way to encode UTF8 in C #?
Later on the StackOverflow found the answer:
Windows handles so-called "Unicode" strings as UTF-16 strings, while the most unixes the default to UTF-8 these days.
The original Windows default Unicode implementation is UTF-16, so encoding.unicode in C # is UTF-16.
System.Text.Encoding.Unicode's comments also demonstrate this:
summary:// Gets An encoding for the UTF-16 format using the little endian byte order.////returns://an encod ing for the UTF-16 format using the little endian byte order.public static Encoding Unicode {get;}
In C #, Encoding.unicode = UTF-16.
The above is the C # Encoding.unicode and Encoding.UTF8 the difference between the content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!