Fuel admin codification problem
Hi, when I edit or create something with special characters like á, ñ, â in a simple module it's displayed correctly in the main page of the module but in the edit view it's displayed with their html entity, example, instead of á, á
it's displayed.
If it's edited by fuel (fuel/module), in the database the value á
is saved, if it's edited by client portal, with a form rendered by fuel, in the database it's saved the correct value "á".
I want to solve this codification problems because when I export data to csv, the special characters are exported wrong. Example: é is exported like é.
Comments
I could solve the problem thanks to this question in stackoverflow http://stackoverflow.com/questions/4348802/how-can-i-output-a-utf-8-csv-in-php-that-excel-will-read-properly
So, in the download_helper of codeigniter I added these lines:
if ($extension == 'csv') { $data = mb_convert_encoding($data, 'UTF-16LE', 'UTF-8'); }
Now, when I export data everything is ok
I really need this to be working because the application I'm doing is in spanish and lot of diacritical signs are used
public function export_data($params = array()) { $data = parent::export_data($params); $data = mb_convert_encoding($data, 'UTF-16LE', 'UTF-8'); return $data; }
Also, if you do need to keep those changes to the download helper, I'd recommend adding your changes to a fuel/application/helpers/MY_download_helper.php instead of overwriting core files.