I noticed that a few of my WordPress posts had strange characters in them, notably the “” character. This seems to be a character set issue between the WordPress web server and the corresponding database. There are various postings on the web on how to resolve this issue, but no one solution resolved this fully for me. This article provides a brief overview of the problem and how I resolved it.
Character Sets
While computers show you pictures and text (like that of this posting), they infact store data in numerical values. Character sets are the text to number translation of a group of specific characters (ex. letters and symbols used in a certain foreign language). Back to the problem at hand – so, if you have the web server saving and displaying posts in one language but the database storing and returning in another, you’ll end up with problems like the one above.
Resolution
1. Remove or comment out the following two lines in your wp-config.php file (While this is the usual suggestion to fix this problem, I don’t believe this does anything as the database and tales had already been created and collation been set):
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '';
2. Correct the database collation (it was probably set to latin1 by default) by running the following SQL query on your wordpress database:
ALTER DATABASE 'YOUR_DATABASE_NAME_HERE' DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
3. Clean up existing posts by running the following SQL query on your WordPress database:
UPDATE 'wp_posts' SET 'post_content' = replace('post_content', 'Â','')
RELATED POSTS:





















































