I was storing data in my MySQL database tables using htmlentities()
but I see that this is inadvisable, so I'm changing it.
I'm now storing data (using PDO prepared statements) in raw format, and converting it as necessary on output. In some instances I want the data to be output as HTML.
The charset of all my web pages which take HTML output is set as utf-8. However I notice on this post that that poster Mythli remarked that, "There is no need to [input to the database using] htmlspecialchars() as you want to display html and no need to [input to the database using] htmlentities() if the character set of your site is equal to the one you use in your database."
I notice that my database tables seem to have the "default character set" set as latin1.
Should I change it to "utf8" ?