I’m building a quick website that uses the "geoanems" database for places round the world. I’m using Mysql, PHP and CodeIgniter but I’m having an issue with the UTF8 places names. I’ve imported the DB and everything is setup with UTF-8.
However, I’m running a simple test to see if I can get the names in the browser correctly, and I’m plagued by question marks all over the place. MySQL shows the correct hex for 1123230’s name and sname, but the same char "C481" is stripped in 1127766’s sname and been replaced by "3F".
What’s going on? Seeing as this is MySQL running the hex why has it changed the values?
Also if I can see it fine for one row, why not the other?
I’ve setup the server for UTF8 and ran checks on MySQL to see if that was set correctly. This doesn’t work in CodeIgniter either :(. I’ve also sent "SET NAMES ‘UTF8’",
but still no joy.
This is the SQL:
$sql = 'select geonameid,name,sname, hex( name ) ,hex( sname ) from pp_adm1 where country = "af" COLLATE utf8_general_ci';

Sequel Pro – Showing Correct Encoding in DB

As elvispt mentioned, check the charset and dbcollat.
The following link will be useful to convert charset of mysql (if thats the problem)
http://www.bdunagan.com/2011/09/29/converting-mysql-from-latin1-to-utf8/
To verify the character set and collation, you can always query the MySQL variables: