Utf8 of charset in MySQL database

Source: Internet
Author: User

When I created an index today, two varchar (200) + utf8 columns reported that the index was too long to exceed 1000 and failed. I checked the information because a uft8 occupies up to three bytes, the details are as follows:

 

UTF-8: Unicode Transformation Format-8bit that allows BOM inclusion, but typically does not. It is a multi-byte encoding for international characters. It uses 8 bits (one byte) for English and 24 bits (three bits) for Chinese characters. UTF-8 contains all the characters needed by all countries in the world, is an international code, universal. UTF-8-encoded text can be displayed on browsers that support utf8 character sets in countries. For example, if it is UTF-8 encoded, Chinese characters can also be displayed on Internet Explorer of foreigners. They do not need to download the Chinese language support package for Internet Explorer.

For more information about UTF-8 coding, see http://zh.wikipedia.org/zh/4108.

UTF-8 encoding is variable length encoding, according to the characters to be encoded to determine the specific length, there is a misunderstanding in the past, that UTF-8 Storage Data Length is fixed.

 

UTF-8: Unicode Transformation Format-8bit that allows BOM inclusion, but typically does not. It is a multi-byte encoding for international characters. It uses 8 bits (one byte) for English and 24 bits (three bits) for Chinese characters. UTF-8 contains all the characters needed by all countries in the world, is an international code, universal. UTF-8-encoded text can be displayed on browsers that support utf8 character sets in countries. For example, if it is UTF-8 encoded, Chinese characters can also be displayed on Internet Explorer of foreigners. They do not need to download the Chinese language support package for Internet Explorer.

For more information about UTF-8 coding, see http://zh.wikipedia.org/zh/4108.

UTF-8 encoding is variable length encoding, according to the characters to be encoded to determine the specific length, there is a misunderstanding in the past, that UTF-8 Storage Data Length is fixed.

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.