I am using tcpdf for pdf generation, and it works great! thanks so far for this great work.
I just was debugging an error where mb_internal_encoding() was always overwritten and tracked it down to tcpdf.
On instance construction it sets mb_internal_encoding to 'ASCII' and on destruction it sets it back to the original - so far so good, but that means, that destruction is obligatory after every use of the object to not modify other script behaviour:
mb_internal_encoding('UTF-8'); echo mb_strlen('ä'); # -> 1, correct $pdf = new TCPDF; # mb_internal_encoding is always ASCII here # everything relying on mb_internal_encoding # in here may not function correctly which # is bad! echo mb_strlen('ä'); # -> 2, wrong in UTF-8! $pdf = null; # mb_internal_encoding is back to original echo mb_strlen('ä'); # -> 1
This should either be stated clearly in the docs somewhere (maybe I missed it?) or, better, it should be changed to not interfere with other scripts in between (maybe setting mb_internal_encoding to ascii only in tcpdf functions which need it and back to original right after?).
Log in to post a comment.