I have a issue when trying to export data from database to excel using PHPExcel. The issue is when there is some norwegian characters in the string. Firstly when I tried entering the data directly, all the the letetrs after the norwegian characters were getting removed. Then I used utf8_decode('dokument pärm'), which is giving the output as "dokument p?rm".
My question is how to include the norwegian and swedish characters and remove '?' marks. Thanks in advance!!!
Code:
require_once '../libs/PHPExcel.php';
/* Set of other includes */
$objPHPExcel = new PHPExcel ();
$objPHPExcel->setActiveSheetIndex ( 0 );
// collecting data from database and saved to $arOrders[0]['content'], say "dokument pärm";
$objPHPExcel->getActiveSheet ()->SetCellValue ( 'A2', utf8_decode($arOrders[0]['content'] ));
$objWriter = new PHPExcel_Writer_Excel2007 ( $objPHPExcel );
header ( 'content-type: application/vnd.ms-excel;' );
header ( 'Content-Disposition: attachment; filename="Report.xlsx"' );
$objWriter->save ( 'php://output' );