DEV Community

Cover image for The Difference Between UTF8 and UTF8MB4 in MySQL
Ajisafe Oluwapelumi
Ajisafe Oluwapelumi

Posted on

The Difference Between UTF8 and UTF8MB4 in MySQL

UTF8 is a popular character set that supports a wide range of languages and symbols.

In MySQL, UTF8 can encode up to 3 bytes per character. The maximum character in Unicode however, requires 4 bytes to encode. As a result, UTF8 cannot fully support all Unicode characters.

On the other hand, UTF8MB4 is an extension of UTF8 and uses a maximum of 4 bytes per character. It can fully support all Unicode characters, including emojis and other special characters.

In conclusion, UTF8MB4 prevents data truncation and encoding errors. It also makes it easier to handle data from different languages.

Distracted Boyfriend Meme

Top comments (0)