dmccabe Posted June 17, 2008 Share Posted June 17, 2008 Hopefully this makes sense, so here goes, I have the £ symbol on some of my pages, but for some reason it is being changed in to a ? within a diamond. anyone know why this is? Quote Link to comment https://forums.phpfreaks.com/topic/110600-%C2%A3-changing-to-in-a-diamond/ Share on other sites More sharing options...
Mattyspatty Posted June 17, 2008 Share Posted June 17, 2008 its something to do with the characterset of your browser. i think you can resolve it by using the HTML code for it. try £ or £ Quote Link to comment https://forums.phpfreaks.com/topic/110600-%C2%A3-changing-to-in-a-diamond/#findComment-567414 Share on other sites More sharing options...
thebadbad Posted June 17, 2008 Share Posted June 17, 2008 Character set set wrong somewhere. It should be the same for your (X)HTML documents, your database collations and your database connection. UTF-8 example: XHTML (inside head tags): <meta http-equiv="content-type" content="text/html; charset=utf-8" /> Database connection (after connecting to database in your PHP script): <?php //call to mysql_connect() saved in $connection, and call to mysql_select_db() goes here mysql_query("SET NAMES 'utf8'", $connection); mysql_query('SET CHARACTER SET utf8', $connection); ?> Quote Link to comment https://forums.phpfreaks.com/topic/110600-%C2%A3-changing-to-in-a-diamond/#findComment-567419 Share on other sites More sharing options...
effigy Posted June 17, 2008 Share Posted June 17, 2008 The pound sign itself is not a valid UTF-8 encoding. See this for more info. Quote Link to comment https://forums.phpfreaks.com/topic/110600-%C2%A3-changing-to-in-a-diamond/#findComment-567423 Share on other sites More sharing options...
thebadbad Posted June 17, 2008 Share Posted June 17, 2008 Then how come it works on my site? It's using UTF-8 all the way (utf8_unicode_ci for database, tables and fields). Edit: Doesn't this imply that it does? I could be wrong though. Quote Link to comment https://forums.phpfreaks.com/topic/110600-%C2%A3-changing-to-in-a-diamond/#findComment-567455 Share on other sites More sharing options...
effigy Posted June 17, 2008 Share Posted June 17, 2008 If you see the pound sign and you're using UTF-8, then it is properly encoded as "£". "£" alone will result in the black diamond question mark. Quote Link to comment https://forums.phpfreaks.com/topic/110600-%C2%A3-changing-to-in-a-diamond/#findComment-567491 Share on other sites More sharing options...
dmccabe Posted June 17, 2008 Author Share Posted June 17, 2008 I will check it out again tomorrow, am at home now so cant look. Thanks so far though! Quote Link to comment https://forums.phpfreaks.com/topic/110600-%C2%A3-changing-to-in-a-diamond/#findComment-567553 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.