guarriman Posted October 18, 2007 Share Posted October 18, 2007 Hi. Working with PHP 4.4 and mySQL 4.1, I've got some texts stored in a UTF-8 table with special chars. I serve a UTF-8 header within my HTML, Apache is configured to serve UTF-8 and PHP scripts are saved in UTF-8 charset. However, sometimes I get 'España' and other times 'Espa�a'. The difference? I press F5 (Refresh) bottom on my web browser (I use Firefox and Internet Explorer). Any similar experience? Quote Link to comment https://forums.phpfreaks.com/topic/73813-special-chars-utf-8-sometimes-ok-sometimes-wrong/ Share on other sites More sharing options...
effigy Posted October 18, 2007 Share Posted October 18, 2007 Are you telling MySQL what to do? See this post. Quote Link to comment https://forums.phpfreaks.com/topic/73813-special-chars-utf-8-sometimes-ok-sometimes-wrong/#findComment-372383 Share on other sites More sharing options...
guarriman Posted October 18, 2007 Author Share Posted October 18, 2007 yep, it fixes the issue: mysql_query("SET CHARACTER SET utf8"); mysql_query("SET NAMES utf8"); Thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/73813-special-chars-utf-8-sometimes-ok-sometimes-wrong/#findComment-372392 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.