fohanlon Posted December 6, 2007 Share Posted December 6, 2007 Hi Can anyone point out a solution to my problem I have built a cms where a user can all in content. The content can contain euro symbols and accented and they get stored ok in a text field in the mysql table. The table is set as utf-8-general-ci. As i read that thsi was the best for storing all symbols. Problem is when the select in done in a web page to view the content the characters are appearing as square boxes. Is there comething like htmlspecialchars I should be running on the content to fix this output? Many thanks, Fergal. Link to comment https://forums.phpfreaks.com/topic/80475-solved-euro-symbol-and-accented-characters-in-mysql/ Share on other sites More sharing options...
effigy Posted December 6, 2007 Share Posted December 6, 2007 Charset Connection. Link to comment https://forums.phpfreaks.com/topic/80475-solved-euro-symbol-and-accented-characters-in-mysql/#findComment-408012 Share on other sites More sharing options...
cooldude832 Posted December 6, 2007 Share Posted December 6, 2007 I have actually had a similar problem before, and I solved it making my own escape phrases sorta like xhtml has or " I just made stuff like € or &passo; and then I did a replace on the output and altered all inputers to use this. Link to comment https://forums.phpfreaks.com/topic/80475-solved-euro-symbol-and-accented-characters-in-mysql/#findComment-408015 Share on other sites More sharing options...
fohanlon Posted December 6, 2007 Author Share Posted December 6, 2007 Thanks effigy How would this work in a mysql select statement? Fergal. Link to comment https://forums.phpfreaks.com/topic/80475-solved-euro-symbol-and-accented-characters-in-mysql/#findComment-408016 Share on other sites More sharing options...
effigy Posted December 6, 2007 Share Posted December 6, 2007 I have actually had a similar problem before, and I solved it making my own escape phrases sorta like xhtml has or " I just made stuff like € or &passo; and then I did a replace on the output and altered all inputers to use this. Not a good idea. Everything will work as-is if everything is UTF-8. Thanks effigy How would this work in a mysql select statement? Fergal. http://www.phpfreaks.com/forums/index.php/topic,159313.msg694931.html#msg694931 Link to comment https://forums.phpfreaks.com/topic/80475-solved-euro-symbol-and-accented-characters-in-mysql/#findComment-408018 Share on other sites More sharing options...
cooldude832 Posted December 6, 2007 Share Posted December 6, 2007 this was before you had to name a collation in mysql Link to comment https://forums.phpfreaks.com/topic/80475-solved-euro-symbol-and-accented-characters-in-mysql/#findComment-408021 Share on other sites More sharing options...
fohanlon Posted December 6, 2007 Author Share Posted December 6, 2007 Thanks Guys for all the comments. Effigy I placed your after my connection to database and before my select sql statement and it worked. mysql_query("SET CHARACTER SET utf8"); mysql_query("SET NAMES utf8"); Many thanks, Fergal. Link to comment https://forums.phpfreaks.com/topic/80475-solved-euro-symbol-and-accented-characters-in-mysql/#findComment-408052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.