1

I have a website where the database mysql collation was in latin_1 and the php files were set with <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">.

Now, the old website worked with PHP 5.4, I'm working with a 5.6 right now so I had to make lost of translations and changes. I'm still working on them, but I still have problems with speciale characters. I changed the db collation with UTF8mb4_unicode_ci and changed the charset of the files where it was written with <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>

I still get errors, seeing sometimes à for é and for ' . Is there something I'm missing? Did I do something wrong? Thanks in advance.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • https://stackoverflow.com/a/36531923/5542121 You most likely did not convert the content? – user5542121 Jul 31 '18 at 14:39
  • Try this: https://stackoverflow.com/questions/40104083/convert-mysql-data-from-latin1-to-utf8 – Dennis Jul 31 '18 at 14:41
  • Unfortunately, I already did convert them, not just manually, but by apdating the entire table. I'll see what else I can try, thank you. – Jeles Keighley Jul 31 '18 at 14:49
  • "updating" entire table sounds strange, u described that u changed the collation - changing the collation does usually not convert the content. – user5542121 Jul 31 '18 at 15:11
  • Mmh, doesn't this do the trick? ALTER DATABASE databasename CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; – Jeles Keighley Jul 31 '18 at 15:14
  • yes I think that does the trick. Last thing coming to my mind is setting the mysql connection from php to the proper charset: https://secure.php.net/manual/en/mysqli.set-charset.php. – user5542121 Jul 31 '18 at 15:25
  • I should have done that too.. I'm checking if I did it correctly. – Jeles Keighley Jul 31 '18 at 15:42

0 Answers0