stevietat Posted March 8, 2009 Share Posted March 8, 2009 So here's the situation: I have a footer element (footer.php) that I am inserting into every page with an include(). In the snippet I have it doing a mysql search, where it will be returning non-latin characters (japanese). If I try view the footer.php snippet by itself, the characters display correctly. But when I include() it in another page, the characters all turn into question marks. The page its been included in has its headers and everything set to UTF-8 and if I copy and paste the code from the footer.php into the page itself, the characters display correctly too. I can only think something is going funky in the include() statement. Is there some way to ensure it is including the file with utf-8 encoding? I've been doing all this work in dreamweaver with utf-8 files, with BOM turned off. Any ideas/advice would be awesome! Link to comment https://forums.phpfreaks.com/topic/148513-include-utf-8-encoding-problems/ Share on other sites More sharing options...
Mchl Posted March 8, 2009 Share Posted March 8, 2009 Make sure HTML charset is declared as utf-8 as well Also run SET NAMES 'utf8' query right after connecting to mysql Link to comment https://forums.phpfreaks.com/topic/148513-include-utf-8-encoding-problems/#findComment-779892 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.