PHPExcel icon indicating copy to clipboard operation
PHPExcel copied to clipboard

Corrupted output if charset is not utf8

Open sirber opened this issue 8 years ago • 3 comments

$this->xls->setActiveSheetIndex(0); $sheet = $this->xls->getActiveSheet(); // works $sheet->setTitle('Ventes par region'); // fails if my page is in Windows-1252 charset $sheet->setTitle('Ventes par région');

sirber avatar Nov 13 '17 19:11 sirber

Have a similar issue. e.g. when ->setTitle("Reporte de Categorías"), in the exported file the property is stored as "Reporte de Categorías". Did you manage to solve the problem?

csrnontol avatar Dec 17 '18 04:12 csrnontol

->setTitle(utf8_encode("Reporte de Categorías"));

sirber avatar Dec 17 '18 13:12 sirber

@sirber Unfortunately utf8_encode did not work, mb_convert_encoding and incov neither. I recently found a solution that works for me: https://stackoverflow.com/a/31973453/3255692

csrnontol avatar Dec 17 '18 16:12 csrnontol