liamloveslearning Posted May 20, 2010 Share Posted May 20, 2010 Hi everyone, I have this <?php setlocale(LC_MONETARY, 'en_GB'); echo money_format('%#4n', $row_getsum['SUM_value']) . "\n"; ?> to output a total figure/sum of all number in my db. The £ sign is being displayed as a question mark (mac) square (PC) stating I have an incorrect character set from what I've gathered, does anybody know how I can combat this? Link to comment https://forums.phpfreaks.com/topic/202385-character-set-problem/ Share on other sites More sharing options...
foxsoup Posted May 20, 2010 Share Posted May 20, 2010 Try converting the pound symbol into the html entity for the symbol before displaying it: <?php setlocale(LC_MONETARY, 'en_GB'); $amount = money_format('%#4n', $row_getsum['SUM_value']) . "\n"; echo htmlentities($amount, ENT_NOQUOTES, 'ISO-8859-1'); ?> Also make sure that the page is being encoding with the matching charset by setting it in the page <head>: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> This is assuming you are making a site with a western Latin charset. Ideally you should use UTF-8 for a greater degree of internationalism. Link to comment https://forums.phpfreaks.com/topic/202385-character-set-problem/#findComment-1061158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.