简体   繁体   中英

umlauts will not be saved in mysql

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 ?

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM