[eluser]Gaz[/eluser]
Hi all,
Just wondering if anybody can help me out with a character encoding problem with MySQL and CI.
Basically I'm importing data from an Excel spreadsheet into MySQL. The spreadsheet gets converted to an array, and some of the fields have foreign-language accented characters, such as é and å.
These characters display fine when I output them to the browser from the array, but when they get inserted into the database they appear as '?'.
The variables returned from the query "show variables like 'character%'" come back as
Code:
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/
I'm using
Code:
header("Content-Type: text/html; charset=utf-8");
on every view, and the database.php config file includes the lines
Code:
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
The results from
Code:
$this->db->last_query();
also show the characters as '?', although they are fine before the query.
Cheers,
Gaz.