-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show correct error on incorrect encoding #594
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not feel like the right fix 🤔
The problem is, that this line:
sets $char to an empty array if $s contains non-utf8 characters
which creates the empty |
Signed-off-by: Ruben Barkow-Kuder <github@r.z11.de>
I moved the error code generation into the function The problem always was before PHP8: if you create
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 |
if(empty($chars)){ | ||
die('TCPDF Error: Incorrect encoding: '.$str); | ||
}else{ | ||
$carr = array_map(array('TCPDF_FONTS', 'uniord'), $chars); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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