Technical - Converting from iso-8859-1 to utf8 or utf8mb4
Do I need to convert to UTF-8?
Short answer: yes.
Modern databases can handle “multibyte characters” such as emojis. Older databases cannot.
If your customers enter emoji symbols in order-comments or contact-us emails, it may trigger errors on your store resulting in unexpected results and lost details.
Also, older database structures don’t handle non-english characters as well as utf8 does, which is why utf8 has been the international “standard” for many years.
Since Zen Cart v1.5.0 all new sites create database tables with the UTF8 character-set.
Since Zen Cart v1.5.6 all new sites create database tables with the UTF8MB4 character-set.
If your site was created from an older version, your database might still contain older database structures that don’t support modern multibyte characters.
To change the database to utf8mb4, use the instructions below.
Converting to UTF8MB4:
1. Use this conversion utility to convert your data to UTF8 (AFTER MAKING AND TESTING A DATABASE BACKUP):
2. Update your PHP files to indicate your UTF-8 intentions.
If you installed your site NEW since v1.5.0 or newer, then the following are ALREADY done for you.
But, if you UPGRADED from a version prior to 1.5.0, then you will need to double-check each of the following:
a. Check each of the following files to be sure that if a define for
CHARSET is present that it is defined as utf-8. (If no define for
CHARSET is present, skip that file and check the next one).
b. Check your
If they have a define for
DB_CHARSET, make sure it is set to utf8 without the dash (not
utf-8). (It may not be present: if so, that’s fine, go to the next file.)
configure.php files are most likely set to read-only on your server, so you’ll need to change their permissions on the server to be writable before you can save the changes you’re making.)
ASIDE: Useful video about the history behind why UTF8 was created: https://www.youtube.com/watch?v=MijmeoH9LT4