UTF-8 WordPress Encoding Issue

1.5k Views Asked by At

We have a WordPress website which is suddenly displaying text and links that look like this:

Note the odd characters.

These links are generated using the EasyAzon plugin, however I do not think this problem is related to EasyAzon. If I turn off that plugin, that same text on the site displays as follows:

Note the odd chars display even with the plugin off.

That same piece of text displays in the Wordpress visual and text editors as follows. You can see that neither editor displays the odd characters:

Note the odd characters are not in the visual editor.

Note the odd characters are not in the text editor.

If I comment out the db_charset and db_collate lines in wp-config.php, this problem goes away:

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

Or, if I keep both lines and change utf8 to latin1, the problem again goes away.

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

But as a side effect of both of these changes/fixes to the wp-config.php file, it breaks the editor. When editing any post, the editor window is blank (both in the visual and text editors). It's not until I return those lines above to this state that the editor returns to normal:

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

How can I resolve the issue with the odd characters displaying on the website without the side effect of breaking the WP editor?

0

There are 0 best solutions below