Wordpress - Character encoding issue after changing servers

After spending the entire day working on this, I finally found a guide that worked perfectly:

  • https://theblogpress.com/blog/seeing-weird-characters-on-blog-how-to-fix-wordpress-character-encoding-latin1-to-utf8/

Before that, I tried following @Rarst's information, tried exporting the database and manually cleaning it, tried the UTF-8 Sanitize Plugin with a modified version from here http://www.prelovac.com/vladimir/ultimate-solution-to-weird-utf-character-encoding-problem (which actually worked pretty well, but didn't fix all the characters. And was probably a terrible idea).

Anyway, if any of you ever encounter this problem, check out the first link I posted. The procedure was pretty simple and basically came down to replacing SET NAMES latin1 with SET NAMES utf8 after exporting the database, then making sure to import the new cleaned database explicitly as UTF8.


Here is another solution which worked for me...

just comment DB_CHARSET and DB_COLLATE in wp-config.php

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

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