op

UTF8 vs UTF8mb4

  • UTF8 vs UTF8mb4

Description

There is a huge discussion the last years about the UTF8mb4 and UTF8 character sets and if there are any dangers updating the database from UTF8 to UTF8mb4. The answer is no. There is no problem updating your database to UTF8mb4 and you should go for the update.

By doing that you have the following advantages:

  • Extended support for almost any languages such as Japanese.
  • Support of all new Emojis 😱
  • UTF8mb4 is modern since UTF8mb4 can hold 4 bytes per character instead of 3 bytes per character on UTF8

What are the requirements to save the data with utf8mb4

  • Your script for example OpenCart should support on the connection between the script and the database UTF8mb4. By default OpenCart uses UTF8. Luckily for you I have made a small VQmod that you can download for free from this site and install it on your website.
  • The collation of the tables should be set on utf8mb4 and each row, depending of it's type should have also a utf8mb4 collation
  • Minimum MySQL Server is 5.5.3. Below this version no utf8mb4 is supported. The release of this version was back on 2010 so 95% of the case you are running on a newer MySQL version.

Also interesting

Do you have questions?