jaymc Posted July 10, 2008 Share Posted July 10, 2008 When a pound sign £ is passed into mysql_real_escape_string it is storing it as this £ Field type is varchar(65500) latin1_general_ci How can I stop this? Thanks Link to comment https://forums.phpfreaks.com/topic/114102-solved-mysql_real_escape_string-%C3%A2%C2%A3/ Share on other sites More sharing options...
effigy Posted July 10, 2008 Share Posted July 10, 2008 You're working in UTF-8: http://www.phpfreaks.com/forums/index.php/topic,163936.0.html What's in your meta tag? Link to comment https://forums.phpfreaks.com/topic/114102-solved-mysql_real_escape_string-%C3%A2%C2%A3/#findComment-586444 Share on other sites More sharing options...
jaymc Posted July 10, 2008 Author Share Posted July 10, 2008 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Ive just changed it to <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> And its still doing the same Link to comment https://forums.phpfreaks.com/topic/114102-solved-mysql_real_escape_string-%C3%A2%C2%A3/#findComment-586446 Share on other sites More sharing options...
effigy Posted July 10, 2008 Share Posted July 10, 2008 Where is the pound sign coming from? $_POST? Did you clear your cache? Is the server enforcing UTF-8? Link to comment https://forums.phpfreaks.com/topic/114102-solved-mysql_real_escape_string-%C3%A2%C2%A3/#findComment-586453 Share on other sites More sharing options...
jaymc Posted July 10, 2008 Author Share Posted July 10, 2008 Ah yes, MYSQL MySQL charset: UTF-8 Unicode (utf8) Is it wrong to be that by default? What should I change it too? Will changing it mess up existing data? Thanks Link to comment https://forums.phpfreaks.com/topic/114102-solved-mysql_real_escape_string-%C3%A2%C2%A3/#findComment-586483 Share on other sites More sharing options...
effigy Posted July 10, 2008 Share Posted July 10, 2008 In today's world I prefer to work everything in UTF-8; although, I rarely use Korean, Chinese, or Japanese and I hear these are preferable in other encodings. UTF-8 overlaps ISO-8859-1 (Latin-1), so if that's all you have, changing it should be transparent. Link to comment https://forums.phpfreaks.com/topic/114102-solved-mysql_real_escape_string-%C3%A2%C2%A3/#findComment-586508 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.