CGridView blank fields

Hi all,

I have to display text content using CArrayDataprovider and CGridView.

The texts may content accentuated characters like "é,è,à, …"

If the input text to display do not content such characters the view rendered by CGridView is OK

but in the other case the coresponding field turn to a blank field.

here are the test data :

$this->_customers = array(

	array(


	'id'=>'780001',


	'name'=>'Martin Pierre',


	'address'=>'12 rue de paris',


	'zip_code'=>'78120',


	'city'=>'Versailles',


	),


	array(


	'id'=>'780002',


	'name'=>'Duval Michel',


	'address'=>'25 rue de versailles',


	'zip_code'=>'78250',


	'city'=>'Montigny',


	),


	array(


	'id'=>'780003',


	'name'=>'Villier [color="#FF0000"]Jérome[/color]',


	'address'=>'47 ave gambeta',


	'zip_code'=>'78560',


	'city'=>'Poissy',


	),


);

If "Jérome" is written like this the result is a blank field (name field)in the grid rendered by CGridView.

If I write "Jerome" the name field is displayed normally.

A var dump of the dataprovider’s data show a bad character instead of the expected “é” :

var_dump($dataProvider->data)

"Villier J�rome"

Is there a localization option to set into CGridView or it is a different problem ?





$this->_customers = array(

array(

'id'=>'780001',

'name'=>'Martin Pierre',

'address'=>'12 rue de paris',

'zip_code'=>'78120',

'city'=>'Versailles',

),

array(

'id'=>'780002',

'name'=>'Duval Michel',

'address'=>'25 rue de versailles',

'zip_code'=>'78250',

'city'=>'Montigny',

),

array(

'id'=>'780003',

'name'=>'Villier Jérome',//The texts may content accentuated characters like "é,è,à, ..."

'address'=>'47 ave gambeta',

'zip_code'=>'78560',

'city'=>'Poissy',

),

);



more clearer that way!

try to encode your file as UTF-8

You were right. Using utf8_encode()has solved the issue.

Thanks