Need Help: Emojis Not Displaying Properly After Hosting

Just to be sure: are you also setting the MySQL connection charset?

phpMyAdmin uses UTF-8 by default, the tables use whatever you configure them to use, but PHP by default uses a different encoding (latin1 if I remember correctly). So if you don’t configure the charset in PHP, then special characters created from your website don’t work in phpMyAdmin, and vice versa.

To fix this, you should always set the connection charset in your PHP code too to match what’s in your database:

https://www.php.net/manual/en/mysqlinfo.concepts.charset.php

And if you think “that’s dumb, why would you have defaults like this”, then I agree, but the unfortunate reality is that we can’t fix this without breaking every website that doesn’t have this set already.

6 Likes