Many website source code is divided into GBK and UTF-8 version, why to develop two types at the same time?

Source: Internet
Author: User
Similar to DiscuzPHPWind, why are two versions developed? utf8 is better. Why is it necessary to release gbk for database compatibility? Similar to Discuz PHPWind, why are two versions developed? utf8 is better. Why is it necessary to release gbk for database compatibility? Reply content: historical reasons are one factor. UTF8 is gradually promoted and is still in the alternate stage.
On the other hand, there are practical considerations. Compared with UTF8, GBK saves some database storage space. UTF8 is better than GBK in internationalization. I don't agree with the saying "UTF-8 encoding in network transmission can save some bandwidth than other encoding methods. Everyone is compatible with ASCII in English. It is a byte and no one saves it. The Chinese UTF8 is mostly three bytes, sometimes more than three bytes, while the GBK is two bytes. This is an open-source project. Radish and cabbage have their own love. It's not tiring to turn around a code. Why should we make some users refuse to use it for this. If it is your own independent website project, of course you have used a code. Of course, we recommend utf8, which is the trend of the times. Yes, mainly to facilitate database collation compatibility

Another point is that PHP has the worst international character processing compared with other mainstream web development languages! If you do not consider character sets other than Chinese and English, gbk is sufficient. In addition to compatibility with multiple languages, UTF8 provides better space usage than GBK. Generally, UTF-8 is used for foreign websites, and gbk is generally used for domestic websites. gbk is the encoding format specially formulated for Chinese Characters in China.

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.