In Text.php
, buildControlCharacters()
constructs array of control characters, but only characters 0 - 19(without 9, 10, 13).
If i create Word2007 file with some other control character, for example 20, generated file is corrupted.
Sample:
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$section->addText('control char 27(ESC):' . chr(27));
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('test.docx');