The problem with writing PHPExcel

I need to write a .xls file with data from a mysql database. Everything is fine, except when there is a field with this line: "FALSE N | NOT USE".

In this case, in a particular cell, it writes only "FALSE N" and stops there without writing "|" and everything that comes after.

These problems also occur with other characters, such as "Ï"

This is a piece of code that writes a file.

while (!$rs->EOF){  
    $objPHPExcel->setActiveSheetIndex(0)
                ->setCellValueExplicit('A'.$i, $rs->fields["nr_id"], PHPExcel_Cell_DataType::TYPE_STRING2)
                ->setCellValue('B'.$i, $rs->fields["descrizione"]) //this is the field that gives me the problem
                ->setCellValue('C'.$i, number_format($rs->fields["prezzo_eur"], 2, ",", ""));
$rs->Movenext();
$i++;
}

Is there a way to write everything?

It is not related to html objects!

UPDATE: I just encoded in utf8 and everything is fine, thanks everyone!

+4
source share
1 answer

As Mark Baker and the author of the question said, the solution:

, , , UTF-8

+1

Source: https://habr.com/ru/post/1598197/


All Articles