I lately converted a classic MySQL database saved as latin1_swedish_ci to utf8_general_ci. I have now got the the HTTP header indicating UTF-8, the HTML tag around the page, and also the data within the database is properly encoded as utf8_general_ci.

Everything works fine on my small testing server, and so i upload the up-to-date HTML files and PHP scripts towards the staging area around the live server. I Quickly replace that old staging database by having an export in the test database.

And today, you will find unicode organizations rather than every apostrophe around the staging site.

Same database, same code, however it does not work there.

The main difference between your test server and also the staging area is the fact that test server may be the following:


  • Apache 2.2.15
  • PHP 5.3.2
  • MySQL 5.1

Staging: (Yes, it's horribly outdated, but it is from my control)

  • Apache 1.3.37
  • PHP 5.2.3
  • MySQL 4.1.15

Any idea what's leading to it not the job around the staging server?

The bond encoding is actually important here. Make certain you apply the same encoding on servers. For instance by giving this because the first command whenever you connect:

SET NAMES 'utf8';

Make certain this is set on each machine's my.cnf you are running mysql on: