Reputation: 37
i will save umlauts in a mysql db so i have an textarea which will be saved with a form. if i dont use any umlauts it will save proper but if i use one of the umlauts it stops to save at the point where the umlaut starts and also cut off the rest of the text..
so i know about the utf-8 and i have in my mysql connection an
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
but what can i do to save this correctly ?
i use mysql_real_escape_string and htmlspecialchars to save but is there something to transform or any kind ?
Upvotes: 1
Views: 1128
Reputation: 1749
MySQL is able to store those characters so you don't need htmlspecialchars to store it in my MySQL database. Once you retrieve it and want to print it, you might want to use htmlspecialchars, but it's not always neccesary. What behavior do you get once you remove htmlspecialchars?
Upvotes: 1