I have some forms that insert some data into a MySQL database, and for some reason characters get double utf-8 encoding. You do not see it in the interface of my website, but in the background you do, if I look at the data from phpmyadmin, it is encoded twice.
Also, to display the data entered with phpmyadmin, I need utf8_encodeit.
If I use uft8_decode()for my data before putting it into my database, it will work, but then I will have to use it again utf8_encode()to display my data correctly, and I would like to find a better solution that rewriting most of my code.
The characters I come across are the Danish characters Γ¦, ΓΈ and Γ₯.
I have all the settings that I can find in php.ini for utf-8, everything I can find in phpmyadmin for utf8, the html meta tag set to utf-8, and still I have this error. / p>
So my question is: does anyone know why this is happening, or how can I fix it? ..
Update: After running the mysql code suggested by Jako, the data is properly encoded in the internal interface of the database when it comes from the interface, but do I still need to run utf8_encode()any ideas to display the data correctly on the interface? ..
Update 2: Again, after running the code from the answer to this question , I still had problems, now the encoding was turned off and off utf8, and I suspect phpmyadmin to restore the encoding in some way. I found a new way to do things, and it works flawlessly, as described in my answer below ...