Php – Arabic characters corrupt on landing, fine after refresh – UTF8

arabichtmlPHPutf-8

I have an php page with mixed Latin and Arabic characters. The charset declaration tag is in the html code

and the file is saved as UTF-8. All the text is static and in the php file (does not come from a DB or an external source)

When I browse to the site some pages randomly get corrupt in IE and FF and display all question marks. After I refresh the page, text is displayed properly though… I have been working with Arabic and Hebrew for a long time and this is the first time I run in to this issue. Can anybody think of a cause?

Chrome is always fine…

Best Answer

Turns out the script reference that was before the meta description was causing the problem. I moved <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> to be the first item after the opening head tag and this is no longer an issue. Thanks for all the comments..

P.S I wasn't the one who code this page, and only working on localizing it, thats why I didn't even think that meta tag being after script would even make a difference...

Related Topic