I have a form sending data to a mySQL database. But when I enter some text like "Jack&Jones", the special characters get transformed into HTML special chars (here, the & becomes "&
").
The data inserted in this database can later be used to generate Word documents using a template, but these HTML characters are read wrong and the resulting file is completely messed up.
I tried to resolve the problem by ensuring all my pages used the <meta charset="UTF-8">
tag and by using header("Content-Type: text/html; charset=utf-8");
to ensure that the data keeps the UTF-8 encoding during the whole process, but it did not work.
So my question is: how do I ensure the encoding consistency between my form, my database and my word document ?