How to Fix a MySQL Character Encoding Mismatch in WordPress

An upgrade to a newer WordPress version, or (as in my case) to a newer version of MySQL, might trigger a problem which has been described since version 2.2: old UTF-8 characters are then represented by strange characters, say “é” will appear instead of “é”.

After reading some posts (e.g. this or this one) about how to fix it, I decided to solve it using one of the simple plugins out there. I tried both, UTF-8 Database converter and WP Sanitize Plugin.

But they just converted the database encoding the simple way. Which was fine, since I don’t care about non-European characters that much. However, there were still a lot of obvious character encoding errors, because the binary encoding was still wrong in many cases.

So I made multiple SQL queries to replace the wrong characters by their correct counterparts, and there it is: I fixed it without using the Shell commands of the aforementioned posts.

If you have the same problem, it will take you seconds to fix your character encoding issue, after having used one of the plugins above (say, UTF-8 Sanitize) and followed its instructions. Then execute the following SQL queries within your blog’s database:

Beware!

  1. Do not change the position of the last query: it should remain the last one.
  2. In that last query, for the wrong character “Ô, you have to choose which of these characters you want it substituted for: “à” (default, preferred if you write mostly in French), “Á”, “í”, “Í” (probably better choices for Spanish blogs), or even “Ï” or “Ý”.

I know, I know, it’s not a perfect solution – but it was indeed easier for me…

WordPress Translation plugin errors corrected – version 1.6.1, now with Google Translate Menu

The latest WordPress Translate Plugin released (1.6) showed an error in the website address conversion. It has been corrected, and a new version 1.6.1 has been released for those languages that had already the plugin with versions 1.5 and 1.6.

Also, a Google Translate Menu version has been included in the plugin package, along with the horizontal and vertical versions. Its output is similar to the one offered by Google, but without the Google style, logos and links, so that it is fully customizable for your blog’s theme. You can see the output of the Translate Menu at the Spanish version of this blog.

Please remember that the IndoEuropean Translator Widget for WordPress is more easily installed, that – unlike this plugin – it includes translation from and into all language pairs offered by Google Translate, and that it also includes all versions offered with this plugin – horizontal, vertical and menu.

The dnghu.php plugin is just a simple code, for those who know some HTML, PHP and/or CSS, who are able to modify the WordPress files, and who want to make the Translation Plugin fit perfectly into their theme.

WordPress Translation Plugin – Added Afrikaans, Belarusian, Persian, Welsh, Irish, Malay, Macedonian, Yiddish..The newest languages in Google Translate

I have added the newest languages offered by Google to the English version of the WordPress Translation Plugin: Afrikaans, Belarusian, Persian, Welsh, Irish, Macedonian, Malay, Swahili or Yiddish.

Because Google is offering a new plugin of its own for any language combination, I think my plugin has become mostly a PHP code to play with, and it will remain so. Their newest Gadget will probably be an excellent tool to offer visitors of any website the possibility to translate with Google, if they don’t have the Google toolbar already installed.

Also, Microsoft is apparently competing with its Bing Translator for the translation engine market, in which Babelfish is still used through Yahoo…

All in all, it’s not a good moment to work on personal plugins that could be replaced in weeks by plugins or gadgets of those big companies, or that could need additions or corrections within weeks. If you want to change or add something to any version of this WordPress Translator Plugin, contact me.

Edit (12 Oct 2009): I’ve added the new language pairs to the German, French, Spanish, Italian, Portuguese and Dutch plugins, which are the most downloaded ones.

WordPress Translation Plugin – Now Google Translation from and into Turkish, Hungarian, Hebrew, Serbian, Slovak, Slovenian, Catalan, Galician, Indonesian,…

The latest improvements and language pairs added to the Google Translation Engine have been included in the simple WordPress Translation Plugin downloadable from this personal blog.

It now includes links to automatic translations from and into all language pairs offered by Google Translation Engine, apart from other language pairs (from individual languages, like English) into other online machine translators, viz Tranexp.

Available language pairs now include (new pairs in bold): English, Albanian, Arabic, Bulgarian, Catalan, Chinese (Simplified and Traditional), Croatian, Czech, Danish, Dutch, Estonian, Filipino, Finnish, French, Galician, German, Greek, Hebrew, Hindi, Hungarian, Icelandic*, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Maltese, Norwegian, Persian*, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian, Vietnamese, Welsh*.

*These languages are only offered as languages to be translated into from the English version.

WordPress Translation Plugin – now using Google Translation from and into Swedish, Finnish, Danish, Norwegian, Polish, Czech, Romanian, Bulgarian, Hindi, Arabic, Japanese, Chinese, etc.

The latest improvements added to the Indoeuropean Translator Widget have been included in the simpler WordPress Translation Plugin available in this personal blog.

It now includes links to automatic translations from and into all language pairs offered by Google Translation Engine, apart from other language pairs (from individual languages, like English or Spanish) into other online machine translators, viz Tranexp or Translendium.

Available language pairs now include English, Arabic, Bulgarian, Catalan*, Czech, Chinese (traditional/simplified), Welsh*, Danish, German, Greek, Spanish, Persian*, French, Hindi, Croatian, Icelandic*, Italian, Hebrew*, Latin*, Korean, Hungarian*, Dutch, Japanese, Norwegian (Bokmål), Polish, Portuguese (Brazilian Portuguese*), Romanian, Russian, Slovenian*, Serbian*, Swedish, Finnish, Tagalog*, Turkish* and Ukrainian*.

WordPress Translation Plugin: ‘Indoeuropean Translator Widget’ – now also Swedish, Danish, Norwegian, Polish, Greek, Russian, Polish, Romanian, Finnish, Chinese, Japanese, Korean, …

The latest upgrades are only available in the simpler WordPress Translation Widget Plugin.

You can download it from the official WordPress Plugin Repository site. New upgrades will automatically appear on your WordPress blog dashboard.

As always, this widget plugin, when activated from the Design tab of your WordPress blog dashboard, will put links – with the tag rel="nofollow", so that search engines don’t follow them – to automatic translations of that website by mainly Google Translation Engine language pairs, to and from (at least) all of these ones into each other, all in all 24×23 language pairs [more or less the number of language translations needed in the European Union…]

The widget offers translations from and into these languages:

English, German, French, Spanish, Italian, Portuguese, Dutch, Arabic, Bulgarian, Czech, Chinese (traditional and simplified), Danish, Greek, Croatian, Hindi, Korean, Japanese, Norwegian, Polish, Romanian, Russian, Swedish and Finnish.

For the latest changes in version 1.1.1 – following Google Translation Engine changes and improvements, you can visit the official release note.

Upgrades for the simple WordPress plugin available in this blog are therefore discontinued not discontinued, due to the need expressed by some bloggers to have this simpler PHP code inserted in their themes, instead of the less flexible widget.

Thanks for the support.