I have a problem with a WordPress site (it’s in Swedish). For some reason I can’t use all characters when I’m writing posts – the characters Ã¥, ä and ö become ÃÂ¥ ä ö. The site is a webshop and I have the Woocommerce plugin installed. The same problem with åäö occurs in the long product descriptions of Woocommerce.
Anyone know what I can do to solve this? The character encoding in WordPress admin panel is set to UTF-8 and so is the database charset in wp-config.
In the database in phpmyadmin the collation of the wp-posts tables are set to “utf8_general_ci”. Is that the problem?
This thing has never happened to me before, even though I have built a lot of WP sites in the past. Therefore I don’t know what to do. Maybe the solution is simple but I want to know what I’m doing before doing anything so I don’t risk messing up the site.
Would really appreciate some help with this, thanks.
When “national special characters”, ie. non-ASCII characters, are displayed wrong, you probably have an error related to charset. The easiest way to fix this is usually to make sure that you are using UTF-8 everywhere.
(For Swedish in particular, you can use ISO-8859-1 (worst), ISO-8859-15 (better) or UTF-8 (best).)
You need to use the same charset everywhere, from the database to the HTML declaration.
UTF-8.
mysql --default-character-set=utf8
In order to fix the Character Encoding Mismatch Problem in WordPress,
Open the âwp-config.phpâ file in a text editor(the wp-config.php file can be found on the directory where you installed WordPress).
Find the following two lines and comment them out:
They should look like the following after you comment them out:
Now upload the updated âwp-config.phpâ file to your webhost.
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.
In another case, if you are using PHP Dom (loadHTML) somewhere, there is a need to load HTML as UTF-8. I have fixed it by:
Replacing
to