0

I fill out a spreadsheet with the information of a person, however, names like D'anna generate a problem in xlsx. D'anna has a square box in place of the apostrophe '. The form of writing that I use is this:

$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($this->excel, 'Xlsx');
$writer->save('php://output');

and at the time of setting the value in the cell, I use:

$planilha->setCellValue(utf8_encode($value['name']);

For the other values, it works correctly, only for the apostrophe that generates problem. Can someone help me? thankful!

DJ_cascurity
  • 57
  • 2
  • 11
Skinper
  • 73
  • 8

1 Answers1

1

I did this:

$worksheet->setCellValue('C25',utf8_encode("D'anna"));

And from the picture, you see it works as expected:

D'anna picture

Anton Menshov
  • 2,266
  • 14
  • 34
  • 55
Hal Egbert
  • 86
  • 1
  • 11