If you’ve upgraded to WordPress 2.2+ and use the same latin1 database, which has nothing to do with UTF-8 (and you want UTF-8 because it’s good for diacritics and Chinese and everything), it’s high time you converted your database.
Seeing as I too finally did it (a few hours ago), I decided to write this simple HOWTO, mostly for people that don’t actively search for how to make this conversion happen but would need it (it’s based on this HOWTO from WordPress).

Requirements:
- WordPress 2.2+
- The SiteUnavailable plugin (to stave off any chance that your visitors add content to your database while you’re converting it) (version 1.0 archived here)
- The UTF-8 Database Converter plugin (which will be doing the conversion per se) (version 2.0.1 archived here)

Steps:

1. Backup your database.

2. Check your backup.

3. Install the two plugins mentioned above (following the installation instructions for each of them – basically uploading them to wp-content/plugins/).

4. Activate SiteUnavailable. From that point on any visitor coming to your site will see a maintenance page (which can be configured by editing the plugin file).

5. Edit wp-config.php from your WordPress root folder by adding the following 2 lines:

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

You can do this by downloading wp-config.php to your computer, using any FTP client such as FileZilla, editing the file in Wordpad (or whatever text editor you’d like), and adding the lines above anywhere between <?php and ?>, saving the file and then uploading it to the server, overwriting the old file.

6. Activate the UTF-8 Database Converter plugin.

7. Go to the UTF-8 Database Converter page, which is available in the Plugins menu.

utf8dbconv.JPG

8. Guess :)

go4it.JPG

9. Deactivate UTF-8 Database Converter and SiteUnavailable from the Plugins menu.

10. Check your site. If all is well you should see no difference whatsoever. On the other hand, if you check your database using phpMyAdmin for example, you’ll see that everything has now been neatly converted to UTF-8.

PS: You can now delete the plugins, of course. You certainly won’t be needing UTF-8 Database Converter anymore (except if you want to use a single WordPress install to convert other databases by just changing wp-config.php settings but I doubt there will be that many sickos out there :) ) and SiteUnavailable… who knows?

Dacă ai trecut la WordPress 2.2+ şi ai rămas cu baza de date veche, care este de fapt latin1 şi nu are nimic UTF-8 (şi chiar vrei UTF-8 pentru că face bine la toate diacriticele astea şi poate stoca inclusiv chineză ca lumea), ar fi momentul să treci la conversie.
Având în vedere că în sfârşit am făcut-o şi eu (acum vreo câteva ore), am zis să scriu un HOWTO simplu, în română, pentru cei care nu caută în mod activ să facă această conversie dar ar avea nevoie (este bazat pe acest HOWTO de la WordPress).

Cerinţe:
- WordPress 2.2+
- Plugin-ul SiteUnavailable (pentru a bloca orice posibilitate ca vizitatorii tăi să adauge conţinut la baza de date în timp ce faci conversia) (versiunea 1.0 arhivată local)
- Plugin-ul UTF-8 Database Converter (care va face conversia propriu-zisă) (versiunea 2.0.1 arhivată local)

Paşi:

1. Îţi faci un backup la baza de date.

2. Îl verifici.

3. Instalezi cele două plugin-uri menţionate mai sus (urmând instrucţiunile de instalare disponibile pentru fiecare – adică upload în folderul wp-content/plugins/).

4. Activezi plugin-ul SiteUnavailable. Din acel moment, oricine intră pe pagina ta, va vedea o pagină de mentenanţă (configurabilă, editând fişierul plugin-ului).

5. Editezi fişierul wp-config.php din directorul rădăcină al WordPress-ului tău şi adaugi următoarele 2 rânduri:

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

Poţi face asta descărcând fişierul wp-config.php pe computerul tău, utilizând orice client de FTP, cum ar fi FileZilla, editând fişierul în Wordpad (sau ce editor de text vrei tu), şi adăugând rândurile de mai sus oriunde între <?php şi ?>, salvând fişierul şi apoi urcându-l înapoi pe server, scriind peste fişierul vechi.

6. Activezi plugin-ul UTF-8 Database Converter.

7. Intri pe pagina plugin-ului UTF-8 Database Converter, disponibilă din meniul Plugin-uri.

utf8dbconv.JPG

8. Ghici :)

go4it.JPG

9. Dezactivezi plugin-urile UTF-8 Database Converter şi SiteUnavailable din meniul plugin-uri.

10. Intri pe site. Dacă totul este bine, ar trebui să observi nici o diferenţă (da, sunt împotriva dublei negaţii). În schimb, dacă vei verifica baza de date folosind phpMyAdmin spre exemplu, vei vedea că totul a devenit UTF-8.

PS: Acum poţi şterge plugin-urile, desigur. De UTF-8 Database Converter în mod cert nu vei mai avea nevoie (exceptând situaţia în care vrei cu o singură instalare de WordPress să converteşti şi alte baze de date schimbând doar setările din wp-config.php însă sunt aproape sigur că nu vor fi mulţi asemenea bolnavi) iar de SiteUnavailable… cine ştie?