I Have Two Question About Data Export To Csv Format File

I’m new to Yii. So I have 2 questions:

1.I’m chinese,so I export data to CSV format about encode question.Please ask me how to set the code about CSV format file?

2.Automatically set the code into the page format, derived data only 10($csv->exportCurrentPageOnly();Is set for this function, should how to set??)

Post code, consult everybody

$sql = 'SELECT b.nick, b.rated_nick, b.item_title, b.item_price, b.content, b.reply FROM voc_rate_result a,voc_rate_detail b

WHERE a.tb_user_id = b.tb_user_id

AND a.id = b.rate_id

AND a.is_process=4’;

$res = Yii::app()->db->createCommand($sql)->query();

$dataProvider=new CSqlDataProvider($sql, array(

‘totalItemCount’=>$count,

‘pagination’=>array(

‘pageSize’=>10,

),

));

$filename = ‘save.csv’;

$csv = new ECSVExport($dataProvider);

$csv->exportCurrentPageOnly(); // if not set will loop through all pages!

$csv->setOutputFile($filename);

$csv->toCSV($filename);