Answer the question
In order to leave comments, you need to log in
How to change the encoding in phpspreadsheet when writing a file?
When saving a csv file in the standard encoding, krakozyabry is obtained instead of Russian letters.
Answer the question
In order to leave comments, you need to log in
Like this for csv, but how do you know for pdf? I would be grateful if you could advise! Here is my question How can I set PDF encoding to UTF-8 in PhpSpreadsheet's library?
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$writerCSV = new Csv($spreadsheet);
$writerCSV->setDelimiter(';');
$writerCSV->setEnclosure('');
$writerCSV->setLineEnding("\r\n");
$writerCSV->setSheetIndex(0);
$writerCSV->setUseBOM(true);
$writerCSV->save($file.'.csv');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question