0
votes

I am having massive problems and very confused of what to do?

My Mysql database Collation: latin1_swedish_ci

My header: meta http-equiv="Content-Type" content="text/html; charset=UTF-8"

Before something goes into the database I do a: html_entity_decode($input, ENT_QUOTES);

If I enter charachters 'åäö' into the database and then display them, they show åäö

What can I do to take care of this? I don't understand. Thank you very much.

1
Thanks, but even if I change the database collation to UTF-8 I have the same problem :(Marcus Silverman
You should try to repair the database; this can be done per table (even per column). Old tables need to be converted. Easiest per mysqldump maybe. And a nice encoding aware, editor like JEditJoop Eggen
I would rather suggest to use utf8_general_ci as Collation and also use varbinary for UTF-8 fields where you want to store UNICODE charactersNullPointer
Did you try set names utf8 before inserting/getting data?Maxim Khan-Magomedov

1 Answers

1
votes

Thanks everyone. I changed from htmlentities() to htmlspecialchars() and everything is fine now.