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. Link to comment 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.