PHPExcel convert XLS to CSV with special characters

Topics: User Forum
Aug 26, 2015 at 10:11 AM

I'm having a small issue while converting an XLS file containing special characters to CSV file using PHPExcel classes.

As exemple the name "Kévin" gives "Kévin" in the CSV generated file.

Here is my current PHP code using PHPExcel :
$excel_readers = array(
        'Excel5' , 
        'Excel2003XML' , 


        $reader = PHPExcel_IOFactory::createReader('Excel5');

        $path = $_FILES['file']['tmp_name'];
        $excel = $reader->load($path);

        $writer = PHPExcel_IOFactory::createWriter($excel, 'CSV');

        echo 'File saved to csv format';
Any help would me much appreciate.
Aug 26, 2015 at 12:19 PM
The spreadsheet content will be saved in the CSV file encoded as UTF-8

Optionally, you can tell the CSV Writer to write a BOM as well
But it's up to the applications reading that file to treat it correctly as UTF-8 data. Applications like MS Excel itself should handle it properly, but text editors like notepad won't recognise the UTF-8 data.
Aug 28, 2015 at 10:45 AM
Edited Aug 28, 2015 at 10:57 AM
[sorry - wrong post]