Killbert
Killbert

Reputation: 171

Wordpress character encoding Issue when editing posts

When I edit a post in Wordpress using the 'Text' mode and enter special characters via using & and euro; for instance for the Euro sign, things work fine. I publish the post and the characters appear ok on my site.

If however I try to go back and edit the page, in the text-mode all special characters are displayed as they are and the encoding is gone (so & euro; is displayed as €).

Here's the strange thing. If I edit a post, go into text-edit mode rather than visual edit and enter a character code and THEN switch to visual mode WITHOUT saving or publishing and THEN switch back to the text edit mode tab, all my character codes are gone and in text edit mode IMMEDIATELY. So & euro; becomes € in text edit mode straight away. This happens both in Chrome and Safari browsers.

On my server I have several Wordpress sites with various WP versions, this happens to WP version 4.4 as well as older versions. My PHP version is 5.5.30.

I checked the following without success:

What else can I check? Can it be a Mac related browser issue as it happens straight away when switching from text to visual mode without saving or updating?

Upvotes: 2

Views: 1862

Answers (1)

Killbert
Killbert

Reputation: 171

I found a solution to my problem finally. This post answered it for me: UTF-8 Character set CentOS PHP

Basically, my PHP.ini settings were wrong.

Setting the following in php.ini helped me out:

default_charset = "utf-8"
mbstring.internal_encoding=utf-8
mbstring.http_output=UTF-8
mbstring.encoding_translation=On
mbstring.func_overload=6

Upvotes: 1

Related Questions