We’ve switched server for one of my client’s website from a CentOS CPanel to a other CentOS CPanel We encountered some irregularities with accents and single quote.
For some reason, some characters are displaying as it should and some are not :
wrong encoding on different sentences
I’ve tried to change DB_CHARSET to utf8 and I’ve also tried to change table collation without success.
Website was running great on former server. Everything is wrong since we’ve changed it.
One of the users has issues connecting to the site as his user group switch every now and then. I don’t know if it could be related ?
Any help would be very appreciated.
3
Answers
FYI, I've found the issue. It was server related.
I've checked the list of PHP extensions that were installed on my server and some were missing...
I don't have the exact list as there was a lot of them missing.
So, for those who have same issues, check your PHP version and extensions.
Try this to Fix Character Problem in WordPress:
As you know that latest WordPress defined DB_CHARSET and DB_COLLATE values in wp-config.php. Which is actually the main reason behind this issue. To fix this issue just comment those two lines in wp-config.php file.
Open wp-config.php file and locate below lines
define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_COLLATE’, ”);
Comment them out and Save that file. After commenting it should look like
//define(‘DB_CHARSET’, ‘utf8’);
//define(‘DB_COLLATE’, ”);
Now upload the updated ‘wp-config.php’ file to your WebHost (overwriting the old one).
This character encoding problem can happen after a database upgrade too so it doesn’t hurt to keep this trick in your mind just in case.
You may experience an error when importing a WordPress
.sql
database from your old hosting to new.So, Try again Export a
.sql
the database file manually via phpMyAdmin on your old host, then import the .sql to your new database. Try bellow steps;Now you should be able to import your
.sql
into phpMyAdmin in your control panel.