PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.19k forks source link

Corrupted output if charset is not utf8 #1351

Open sirber opened 7 years ago

sirber commented 7 years ago

$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');

csrnontol commented 5 years ago

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?

sirber commented 5 years ago

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

csrnontol commented 5 years ago

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