I had the problem as same as yours, after I change Collation to utf8_unicode_ci from table and attribute (some attribute needed to change), and it work now~
nlublovary: it is nonsense that htmlentities()
wouldn’t be safe, though it may have been used incorrectly.
Don’t remove it as it would open you up to all sorts of hacks if you do.
Better to add the characterset as a third parameter to the function:
htmlentities( $string, FLAGS, 'utf-8' );
More info:
http://nl2.php.net/manual/en/function.htmlentities.php
jrf: htmlentities() will corrupt UTF-8 data unless the author would use the appropriate flags, the proper syntax would be: htmlentities( $string, ENT_COMPAT, 'UTF-8' );
While htmlentities() might be used to protect to a certain degree against XSS/SQL attacks, using it is bad practice. Folks recommend to use htmlspecialchars() instead, as it does the same, but doesn’t corrupt the UTF-8 data and it makes no sense to convert every character to it’s html representation, e.g. être = être
. Best would be to use the built-in function: esc_html($string)
However, htmlentities() is applied to sanitize the data while displaying (echo), but the data itself is saved into the database as-is, including html tags and possible hacks. Perhaps it would be a good idea to wrap the data while saving e.g: strip_tags($string)
Allowing html tags e.g. in the name of a new Quizz might break the layout, try this and you’ll get a blank page after saving: <script>My Quizz