View Full Version : Character Collations

04-09-2009, 03:45 PM
I have a database with languages. I have german-english, spanish-english, and latin-english tables, which provide translations.

In phpMyAdmin when I browse the tables, the special characters show, such as , but when I pull the data out, the letters are replaced with alternatives ( becomes ß).

I have tried setting the collation to utf-8-unicode, utf-8-general, latin1-german1-ci, and the default latin1-swedish-ci, both on the table and the individual row. What should they be set to, or is this an issue with PHP which is pulling out the data?

04-09-2009, 03:48 PM
Have a try by setting utf-8-general and then executing the following query before insertion and retrieval of data.

mysql_query("SET NAMES 'utf8' ");

04-09-2009, 04:01 PM
It appears to still display the wrong characters, does this mean its not mysql?

04-09-2009, 04:07 PM
It was encoded, perhaps by CodeIgniter, just needed to parse it with this

mb_convert_encoding($data[$i][$entry], 'HTML-ENTITIES', 'UTF-8')