00 Votes

Diacritics and Unicode Characters no longer displayed correctly after PHP Switch

Question by Guest | 2016-06-07 at 17:16

Not long ago, my provider made an update to a newer PHP versions for me. Up to now, those updates always happened without any problems and I never had to change my website afterwards.

However, it was a different this time. Suddenly, all diactrics, umlauts, accents and other Unicode characters stopped working to display properly on my webpage. Instead, only strange hieroglyphics such as ü, ö or ä were shown.

I had a similar program when setting up my home page. At that time, it helped to specify "text/html; charset=utf-8" in the head of my website. I have never changed this so, it is already standing there. However, this statement seems not to help at this point. Does someone have any idea to fix this problem?

0Best Answer0 Votes

Not long ago, I had a similar problem and I managed to solve it in the following way:

My website is UTF-8 encoded and that is also specified in the head of the HTML page. However, the browser failed to display diacritics, accents, umlauts and other Unicode characters correctly.

On closer inspection, I saw that my server send some header information that my website is ISO 8859-1 encoded (that is Latin 1). With this additional information, of course, the browser found contradictory conflicting data and obviously believed more in the head of the page than in the page itself.

This error also occured after a PHP change-over for the first time. Now, you have to possibilities to solve the problem. If you have access to the PHP INI, you can change the default encoding settings there. If not, you can also change the header directly using PHP. How to do that, you can learn in the thread about how to set UTF-8 charset in HTTP header using PHP.
2016-06-07 at 18:00

ReplyPositive Negative

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.


Ask your own question or write your own article on askingbox.com. That’s how it’s done.