How to distinguish between GBK and UTF 8 applications

recently, a lot of friends have just come into contact with some PHP programs and have been confused by the choice between GBA and UTF-8, the two uses.

so I must, the actual meaning and purpose for the general description of some of the information of the two encoding, master drifting, newcomers feel useful

1 distinguishes

from bytesThe literal encoding of

GBK is double byte, that is, both Chinese and English characters are represented by double bytes, but only 1 is used to distinguish the Chinese from the highest.

UTF-8 encoding is a multi byte encoding used to solve international characters. It uses 8 bits (one byte) in English and encodes 24 bits (three bytes) in chinese. For forums with more English characters, use UTF-8 to save space.

two, which distinguishes

from characters

GBK contains all Chinese characters;

UTF-8 contains all the characters needed by all countries in the world.

three, coded to distinguish

GBK is a standard compatible with GB2312 after the expansion of the national standard GB2312 (as if it is not a national standard),

UTF-8 encoded text can be displayed on various browsers that support the UTF8 character set in various countries.

, for example, if it is UTF8 encoding, you can also display Chinese on the English IE of foreigners without having to download the IE Chinese language support package. So, for more English forums, GBK uses 2 bytes per character, while UTF-8 uses only one byte.

four, used to distinguish between

GBK is Chinese state encoding, general worse than UTF8, but UTF8 has a database of more than GBK, and is a general forum for the DZ program, the corresponding component and plug-in support GBK developed a more comprehensive, more convenient time to DIY.

UTF8 is international code, it is better in general, foreigners can also browse the forum, and Chinese can be directly identified, and if you want to do more internationalization of the forum, you must use UTF8.

added: UTF8 has advantages over GBK in terms of traditional support.

for the DZ forum, many plug-ins support GBK only, and if you need to install more plug-ins, the forum is better with GBK, and for less plug-ins, and there are special user forums, UTF8 is better.

so, generally if you do forum is a specific circle of home in the use of the GBK simple, basic plug-in can be installed, but if you have foreign market need to recommend UTF8, < >

Leave a Reply

Your email address will not be published. Required fields are marked *