I have a site under construction where user posts are displayed. In the development server(on Windows XP) using PHP 5.2.5 and Apache 2.2.6 it is fine,i.e.,special characters are displayed as it is by adding the charset meta tag into the header section of the html page:
<meta charset="utf-8">
And echoing like this:
echo html_entity_decode($postBody, ENT_QUOTES, 'UTF-8');
Then,for example,results are as follows:
███─█─────█─███─███─███ █───█─────█─█───█────█ ███─█──█──█─██──██───█ ──█─█─█─█─█─█───█────█ ███─██───██─███─███──█
███─███──███─███─██───█─███─ █───█─█───█──█───█─█──█─█──█ ███─██────█──██──█──█─█─█──█ █───█─█───█──█───█───██─█──█ █───█──█─███─███─█────█─███─
Currently,I have uploaded my project into a new development server (on Windows7) with PHP 5.6.29 and Apache 2.4.23 where the same page is displayed as below:
███─█─────█─███─███─███ █───█─────█─█───█────█ ███─█──█──█─██──██───█ ──█─█─█─█─█─█───█────█ ███─██───██─███─███──█
███─███──███─███─██───█─███─ █───█─█───█──█───█─█──█─█──█ ███─██────█──██──█──█─█─█──█ █───█─█───█──█───█───██─█──█ █───█──█─███─███─█────█─███─
In the new environment, I have also tried with:
echo utf8_encode($postBody);
But it was fruitless. I also added in the httpd.conf:
AddDefaultCharset utf-8
The default_charset in PHP has been checked and also found to be utf-8.
But it was all in vein.
I have also checked the character_set_database in MySQL in both the servers(previous and new) which is found to be latin1.
I am pointless as why the same page displayed differently in two versions despite trying myself this little bit. What are the possibilities that lead me to such problems and how will I come out of it with a solution? Thanks in advance!