otuatail Posted November 2, 2017 Share Posted November 2, 2017 Hi. I have a web page that allows a comment field where any charecter can be entered including ' " and £. I enter this into a database `Comment` varchar(32) NOT NULL DEFAULT '', When this is displayed sometimes the pound symbol is displayed as a black demimonde with a question mark. It has a ascii value of 0. How can I fix this? I enter it into the database as Comment = str_replace ( "£", "£", $Comment ) ; This doesn't fix it. It works fine when i enter it into the DB as \' and \". TIA Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/305525-problems-with-%C2%A3/ Share on other sites More sharing options...
requinix Posted November 2, 2017 Share Posted November 2, 2017 Make sure your table, your database connection, your scripts, and your web pages are all using UTF-8. At least one of them is not. And don't do the str_replace() thing. Leave it as the £ character and fix the underlying problem of the character not being stored correctly. Quote Link to comment https://forums.phpfreaks.com/topic/305525-problems-with-%C2%A3/#findComment-1553304 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.