0

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 3

0

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.

  1. Open wp-config.php file and locate below lines

    define(‘DB_CHARSET’, ‘utf8’);

    define(‘DB_COLLATE’, ”);

  2. 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.

4
  • Thanks for replying, unfortunately, it's worst now than before :/ Every character with accent shows �
    – Etienne
    Dec 4, 2019 at 2:51
  • Can you try to contact the hosting company? they will help you to make a solution.
    – Nmk
    Dec 4, 2019 at 17:22
  • They are really slow to answer but I've message them twice already. I've tried several things, none worked... I really don't understand how some character could show nicelly as it should and the same ones in the same sentence just fails...
    – Etienne
    Dec 4, 2019 at 20:34
  • I add another solution to try it
    – Nmk
    Dec 6, 2019 at 14:39
0

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;

  • Open phpMyAdmin & select your database
  • Click the "Export" tab for the database
  • Click the the "Custom" radio button - In the section titled "Format-specific options:", change the option for the "Database system or older MySQL server to maximize output compatibility with" from 'NONE' to 'MYSQL40'.
  • Scroll to the bottom and click "GO".

Now you should be able to import your .sql into phpMyAdmin in your control panel.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.