Closed rubo77 closed 1 year ago
The problem is, that this line:
// get array of unicode values
$chars = TCPDF_FONTS::UTF8StringToArray($s, $this->isunicode, $this->CurrentFont);
sets $char to an empty array if $s contains non-utf8 characters
UTF8StringToArray()
calls this line:
$chars = TCPDF_STATIC::pregSplit('//','u', $str, -1, PREG_SPLIT_NO_EMPTY);
which creates the empty array()
I moved the error code generation into the function UTF8StringToArray()
.
The problem always was before PHP8: if you create
new TCPDF(pageFormat, $unit, $pageSize, $isunicode)
with $isunicode== true, and there are non-utf8- characters in a string, the PDF generation was just ignoring this whole Cell for that string, leaving it empty without errror warning.
This should enlighten users a bit, what is going wrong then
Maybe we should add and !empty($str)
?
Please resolve this someone else. Sorry I don't have the time any more
Signed-off-by: Ruben Barkow-Kuder github@r.z11.de
E.G if you try this:
You will get this error on PHP 8.1:
This commit will show a useful error with the causing string