3

I've imported WordPress post data onto a new site and noticed I have strange characters showing on pages and Blog posts.

It usually shows where apostrophes should be.

I've searched multiple solutions to UTF8 & latin1 solutions with success. I've looked at my database and the characters are showing there too.

strange characters in post

strange characters in database

  • 3
    It looks like encoding was messed up during import. – Krzysiek Dróżdż Jul 31 '18 at 11:41
  • You said: "I've searched multiple solutions to UTF8 & latin1 solutions with success", don't you mean: "... without success"? – Fayaz Aug 1 '18 at 15:07
  • 2
    Do a database dump with mysqldump, and then search & replace the strange characters within the DB dump file, then reimport that database. I've solved a similar problem using the same method. This will only work if the error is from a single consistent encoding corruption. – Fayaz Aug 1 '18 at 15:10
  • 1
    Best guess that's a soft hyphen, character code AD which would UTF-8 encode to C2 AD where C2 = A-with-circumflex, and you've somehow stripped the circumflex too?, and AD = soft hyphen again, which may well not be printable and so the missing character symbol you've got there. So this might be UTF-8 and diacritics stripped, meaning you're unlikely to be able to automatically recover this: a manual search-replace is probably going to be best. – Rup Aug 1 '18 at 23:06
  • 1
    And FWIW I think your example "founded in" would be wrong with a hyphen. – Rup Aug 1 '18 at 23:07
0

What is your database encoding? Try to switch to utf8mb4.

Alternatively, try to add one of these lines in your wp-config.php file:

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

or

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

or

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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