Special characters Codeigniter PHPExcel

1

I have a function that extracts data from a DB and exports them to an excel file, the problem is that it does not show any characters or special characters (No.)

This is my code:

$this->excel->getActiveSheet()->setCellValue('I16', 'N° Serie');
header('Content-Type: application/vnd.ms-excel'); //mime type
header('Content-Disposition: attachment;filename="'.$filename.'"');
header('Cache-Control: max-age=0');

What it prints to me:

N° Serie

utf8_encode () did not work, some help ... thanks!

    
asked by Alf 22.10.2018 в 20:59
source

1 answer

2

You can try using utf8_decode () , I made a simple example so you can guide here , and with your code you would stay like this:

$this->excel->getActiveSheet()->setCellValue('I16', utf8_decode('N° Serie'));
header('Content-Type: application/vnd.ms-excel'); //mime type
header('Content-Disposition: attachment;filename="'.$filename.'"');
header('Cache-Control: max-age=0');

all depending on how it comes from the BD. I hope it serves you.

    
answered by 22.10.2018 / 22:01
source