c_shelswell Posted June 9, 2009 Share Posted June 9, 2009 Hi I'm really struggling to get characters to display properly. I'm trying to make a site that can show multiple languages where a user has a test input i'm storing it in the DB using htmlentities then where it displays html_entity_decode. This seems to be working fine. There's also parts where the data is just input to the DB using phpMyAdmin. If i have an e with an accent it won't display unless I use htmlentities. My charset is currently UTF-8 which displays the above fine but if i change it to allow the e accents to display it ruins the above. Surely I don't have to add htmlentities to each place where strange characters might appear? If you have any help I'm be really grateful. I'm running rapidly out of hair to pull out! Oh the test string i'm using is: "test"///\\\'''deü©ΣДçگẫ_cur£$ Cheers Link to comment https://forums.phpfreaks.com/topic/161504-solved-help-with-character-coding-and-htmlentities/ Share on other sites More sharing options...
c_shelswell Posted June 11, 2009 Author Share Posted June 11, 2009 For anyone else that comes across this problem. It was a case of setting all collation in the database (the DB itself, tables and fields) to utf-8 then setting the web page to utf-8 and also adding this after connection to the database: mysql_query("SET NAMES 'utf8';"); cheers Link to comment https://forums.phpfreaks.com/topic/161504-solved-help-with-character-coding-and-htmlentities/#findComment-853629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.