My MySQL charset is set to UTF8, stores the data correctly, even displays it nice on the screen, but when I export it to XLS or PDF I get weird characters back.
- when I set the default charset in the main.php file
is this equivalent to any of these options?
SET NAMES 'utf8'
SET CHARACTER SET utf8
if so, how can I set the other one?
It is equivalent to SET NAMES.
Setting character set:
Yii::app()->db->getPdoInstance()->prepare('SET CHARACTER SET ?')->execute(array('utf8'));
I’ve already tried that my ű and ő chars are still messed up. It is weird.
Do you wish to export with phpmyadmin or something else?
no, the users will have 3 options:
view the list on the screen (works fine)
export it to an XLS sheet (chars messed up)
export it to a PDF file (chars messed up)
I’m pretty sure it’s something with either the PHP or the MySQL settings. But have to find the right one, i guess