I have a dropdown list, which lists things that has french characters in it. Although I see characters like this:
MySQL database is set to UTF-8. So, there is no problem in database. I've checked the database and characters are okay.
I also added these lines to my header.php but still doesn't work.
header('Content-Type: text/html; charset=utf-8');
<meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
What else should I do?
EDIT I can print french letters everywhere in the site but still dropdown doesn't work.
SOLUTION First of all, if you would like to use utf-8 in your site you should add this right after you connect to database:
mysqli_set_charset($connectionName, 'utf8mb4');
Second, you should also add this in your header tags:
<meta charset="utf-8">
That's all. After all these, my problem still wasn't fixed until I figure out my stupidity. I have header.php file, which is included on top of every page but there is another php file, which outputs dropbox options from database. So, this file don't need header.php at top. So, I had to add mysqli_set_charset($connectionName, 'utf8mb4'); specially for that page.