imehesz
(Imehesz)
July 15, 2009, 5:06pm
1
hello,
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.
My question:
when I set the default charset in the main.php file
return array(
......
'components'=>array(
......
'db'=>array(
'connectionString'=>'mysql:some_sql_stuff_here',
'charset'=>'utf8',
),
),
......
);
is this equivalent to any of these options?
SET NAMES 'utf8'
SET CHARACTER SET utf8
if so, how can I set the other one?
thanks,
–iM
pestaa
(Pestaa)
July 15, 2009, 8:05pm
2
It is equivalent to SET NAMES.
Setting character set:
Yii::app()->db->getPdoInstance()->prepare('SET CHARACTER SET ?')->execute(array('utf8'));
imehesz
(Imehesz)
July 15, 2009, 8:09pm
3
thanks,
I’ve already tried that my ű and ő chars are still messed up. It is weird.
i
pestaa
(Pestaa)
July 15, 2009, 8:14pm
4
Do you wish to export with phpmyadmin or something else?
imehesz
(Imehesz)
July 15, 2009, 8:34pm
5
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
thanks though,
i