0

I have a very strange behavior on a WordPress Website.

If define the Charset in wp-config.php like:

define('DB_CHARSET', 'utf8');

The frontend of the website is almost fine, but:

  1. Images with umlauts in URL are not found
  2. In The backend WooCommerce addresses shows "Straße" instead of "Straße", "Müller" instead of "Müller" and so on
  3. Yoast Descriptions and titles have the same problem which is on some other places too.

If I do not define a charset in the wp-config.php like:

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

...the backend and the images are fine, but there are these diamonds with question marks on frontend all over the place. For example: "F�r den fr�hlichen S�nger J�rg M�ller"

This all happened since an update try of WordPress and plugins today and restoring a backup from yesterday or earlier does not solve it.

The plain text, which is meant to be displayed in the frontend, has the regular ä,ö,ü,... in the database tables, as well as the Yoast titles and descriptions in their tables.

The address information and Image URLs are stored with "ä, ö, ü,..."

So if I define charset, something is wrong, if I don't do it, something is wrong too. I do not know how to solve this from here.

Any suggestions?


Hoster: Cloudways - PHP: 7.4 - DB: Maria DB 10.2

Which Theme and which WordPress version does not matter...

MrMash
  • 1
  • 1
  • Is database collation set to right encoding? – Zed Dec 17 '20 at 21:29
  • @zed what would be "right" in your oponion? – MrMash Dec 17 '20 at 22:15
  • Encoding such as UTF8. – Zed Dec 17 '20 at 22:28
  • so you mean if i set define('DB_COLLATE', 'utf8');?... still the same... – MrMash Dec 17 '20 at 22:34
  • I mean, When your create or update database you should set collation, It might be set as default collation, Log in to your phpmyadmin and check the db collations. – Zed Dec 17 '20 at 22:42
  • Sorry I had to look here first. Most columns have latin1_swedish_ci set, I think that is the problem right? – MrMash Dec 17 '20 at 23:11
  • Hmmm, It might be the cause of problem. change it to UTF8 if you can, Before that please take a backup from your database. – Zed Dec 17 '20 at 23:13
  • the table wp_yoast_indexable is using. utf8_general_ci... – MrMash Dec 17 '20 at 23:15
  • some of the values are still stored with "ä, ö, ü,..." and so on. i think that has to be done by search and replace, right? – MrMash Dec 17 '20 at 23:53
  • Does this answer your question? [Trouble with UTF-8 characters; what I see is not what I stored](https://stackoverflow.com/questions/38363566/trouble-with-utf-8-characters-what-i-see-is-not-what-i-stored) – Rick James Dec 20 '20 at 20:20
  • See mojibake and black diamond in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Dec 20 '20 at 20:21

0 Answers0