What is the difference between UTF-8 and GBK? Which one is better?

Source: Internet
Author: User

GBK is compatible with the gb2312 standard after expansion based on the National Standard gb2312 (it does not seem to be a national standard ). GBK encoding is specifically used to solve Chinese encoding, Which is dual-byte. Both Chinese and English are dubyte.
UTF-8 encoding is a multi-byte encoding for international characters. It uses 8 bits (one byte) for English and 24 bits (three bits) for Chinese characters. For forums with many English characters, use a UTF-8 to save space. In addition, if a foreigner accesses your GBK webpage, You need to download Chinese Language Pack support. This problem does not occur when you access a Web page with UTF-8 code. Direct access.
GBK contains all Chinese characters; UTF-8 contains all the characters needed by all countries around the world.
Some people often ask the website to write UTF-8 and GBK which code is good, according to personal needs, if you mainly do Chinese program development, the customer is also mainly Chinese, then use GBK, because the Chinese character of UTF-8 encoding uses three bytes, using GBK saves space.
If you are developing an English website, use UTF-8, because UTF-8 occupies only one byte in both Chinese and English. GBK is two bytes in both Chinese and English, and foreign customers need to download the Language Pack when accessing GBK.
If your website is Chinese, but there are many foreign users, it is best to use UTF-8.

 

UTF-8-encoded text can be displayed on various browsers that support utf8 character sets.
For example, if it is UTF-8 encoded, Chinese characters can also be displayed on Internet Explorer of foreigners, without the need to download the Chinese language support package for Internet Explorer. Therefore, for more English forums, use GBK each character occupies 2 bytes, while use UTF-8 English only occupies 1 byte.
Utf8 is an international code, and its versatility is better. Foreigners can also visit the Forum. GBK is a national code and its versatility is worse than utf8, but the database occupied by utf8 is larger than GBK ~

What is the difference between UTF-8 and GBK? Which one is better?

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.