I moved my website from my local test server to NameCheap shared hosting and now I’m running into a problem – some of the pages aren’t displaying utf-8 special characters properly (showing question marks instead). All pages are utf-8 encoded, as are all database tables. The strange thing is, some pages display correctly and some don’t, in a seemingly random pattern.
For instance, my index page is fine, but my profile page isn’t. faq.html works fine, but when I rename it to faq.php it doesn’t. And weirdest of all, I have a page with two JQuery tabs where one displays correctly and the other doesn’t!
Can someone help me out with this?
This is really annoying problem to fix but you can try these.
First of all, make sure the file is actually saved in UTF-8 format.
Then check that you have
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">in your HTML header.You can also try calling
header('Content-Type: text/html; charset=utf-8');at the beginning of your PHP script or addingAddDefaultCharset UTF-8to your .htaccess file.