When storing data in mysql using the UTF8 charset, does it make sense to escape entity characters when the data is being input or is it better to store it in raw form and transform it when pulling out?
For instance, let’s say someone enters a bullet (•) character into a text box. When saving that data, should it be converted to • before being input? Or would it make sense to enter it as a bullet, then convert when pulling out?
I guess I’m just not sure on the best practices for storing non-ascii data. Any thoughts would be greatly appreciated.
If you are using the UTF-8 charset for your whole application (i.e. MySQL, but also the encoding of your HTML pages, your scripts, code, and all that), there is no need to tranform “special characters” into entities : just send your text data as UTF-8 too 😉