DanielHardy Posted March 26, 2010 Share Posted March 26, 2010 I know this is a common problem. I did also have a problem with the browser adding backslashes around apostrophies, but this was solved by editing the magic quotes setting. However I am still having trouble adding the £ symbol. Let me know if you need any code. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/ Share on other sites More sharing options...
beamerrox Posted March 26, 2010 Share Posted March 26, 2010 code is usually helpful, but from a standpoint, i think your html is set to the wrong charset to display that character...shouldn't be a php issue... Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/#findComment-1032247 Share on other sites More sharing options...
DanielHardy Posted March 26, 2010 Author Share Posted March 26, 2010 Code is usually helpful, but i thought it would be mainly unecessary as this seems to be a configuration problem. It displays that character fine when simply typed in html, it's the php echo that causes the issue...... Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/#findComment-1032250 Share on other sites More sharing options...
phant0m Posted March 26, 2010 Share Posted March 26, 2010 Where does the £ sign come from? Straight from PHP source code? If yes, your file's encoding is different from what you specify on in your HTML code. depending on the editor you use, it should be selectable (the file's encododing) Do you have a meta entry to set the charset option? "Simply typed in HTML" how do you mean? Do you use a WYSIWYG editor? If yes, it might have used it's html entity instead of the actual character, to avoid that very problem. Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/#findComment-1032252 Share on other sites More sharing options...
DanielHardy Posted March 26, 2010 Author Share Posted March 26, 2010 The £ sign is being edited in the browser and saved to a html file (this html file has no html coding, or indeed a charset). The html files contents are then echoed back onto the screen. In short, i think it is using its html entity instead, how do i combat this? Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/#findComment-1032258 Share on other sites More sharing options...
oni-kun Posted March 26, 2010 Share Posted March 26, 2010 The £ sign is being edited in the browser and saved to a html file (this html file has no html coding, or indeed a charset). The html files contents are then echoed back onto the screen. In short, i think it is using its html entity instead, how do i combat this? htmlentities .. May help. Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/#findComment-1032260 Share on other sites More sharing options...
beamerrox Posted March 26, 2010 Share Posted March 26, 2010 html_entity_decode more like Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/#findComment-1032262 Share on other sites More sharing options...
DanielHardy Posted March 26, 2010 Author Share Posted March 26, 2010 decode didn't work. The file accepts the $ symbol, and almost every other symbol, but for some reason not the £. Are there any other suggestions guys? Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/#findComment-1032290 Share on other sites More sharing options...
JonnoTheDev Posted March 26, 2010 Share Posted March 26, 2010 The £ sign is being edited in the browser and saved to a html file (this html file has no html coding, or indeed a charset). Wherever you are saving this to, if the final output is HTML then it should be converted to a html entity before saving. £ should be saved as £ You will get issues for instance if you try and save a £ symbol straight into a database table without the correct encoding. Quote Link to comment https://forums.phpfreaks.com/topic/196605-browser-displaying-weird-characters-instead-of-%C2%A3-sign/#findComment-1032292 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.