I bet that most people who host a multilingual blog on a WordPress installation (or who would have wanted to be able to do so) have at least once faced the following problem: incomprehensible characters instead of legible words. This is especially true when WordPress installations have been setup through a cPanel wizard.
So, what is there that stops wordpress installations from correctly displaying characters other than those in English?
For starters, we need to make sure that our cPanel wizard allows the use of character sets other than English. In order to be able to do that, cPanel needs to use the “english-utf8” character set.
1. In my cPanel wizard there’s a dedicated section called “Quick Start” and there in, there’s a “Change Language” option (shown in orange above). Clicking on it will display the language options of our cPanel installation. Most probably, it will say “Set language to:” and in the right there will be a drop down menu listing “english” as the language of choice. You need to choose the “english-utf8” option from the drop down in order to allow character sets other than English to display correctly. Once you have selected the “english-utf8” option, click on the “Change” button and your installation will be setup correctly.
What you now need to do, is enable “utf8” character sets within your SQL databases.
2. Go back to your cPanel wizard and locate your phpMyAdmin icon. Click on it and you’ll visit your php configuration.
As you can see on the above screenshot you need to change your character set to “UTF-8 Unicode (utf)”. Also, you need to change the “MySQL connection collation” to “utf8_unicode_ci” in the drop down menu.
Unfortunately, that is not all. That was just the easy part up to here.
You now need to change the encoding for all the databases and all the tables and all the fields within the tables one by one.
In the left hand column, below the pypMyAdmin logo, you will see the list of databases present in your installation (blurred out in the screenshot above). Clicking on one of them will open up the options screen for the specific database.
3. Make sure you click on the database used by your WordPress installation. A WordPress installation will have the following tables: wp_comment, wp_links, wp_options, wp_postmeta, wp_posts, wp_terms, wp_term_relationships, wp_taxonomy, wp_usermeta, wp_users The above 10 tables will unfortunately have to be setup individually. Even worse, individual cells/fields within those tables will have to be setup one by one as well.
4. First of all click on the “Select All” option and make sure that all tables have been ticked. Then click on the upper right hand corner “Operations” option. Locate the “Collation” option (near the bottom of the screen) and select “utf_unicode_ci” in the drop down menu. Just click on “Done” once you’re done.
5. One you’re done, you need to go back to the previous screen where the list of tables is displayed. Next to each table you will see a column with a number of icons. Click on the second icon which looks like a finger pointing at a notepad (called structure) and you’ll be taken to a screen displaying the table’s structure. What you now need to do is click on “Select All” (so that all fields will be ticked) and then click on the second icon next to “select all”, the one that looks like a pen (called “Change”).
6. In the new screen, the fourth column is called Collation. You need to change ALL drop down menus that ALREADY have a value to “utf8_unicode_ci”. It is the last option in the drop down menu. Once you have done that, you need to click on the “Save” button.
7. Having saved the new character set, click on “Operations” in the top bar and make sure that the general collation option for the entire table is set to “utf8_unicode_ci”. Click on “Done”.
8. Once you’ve done all of the above, you need to select the next table, in the column on the left of your screen and follow through the steps for that table as well.
You need to keep doing this for all the tables in your database. Just select the next table and repeat steps 5-8 until you have finished changing collation for all tables and all fields in your database. If you’re successful, your posts will be able to display words from all languages supported by the utf8 encoding.