ZF-7178: ZendPDF::save() may fail when mb_detect_encoding returns false
When saving a PDF with improperly encoded data, mb_detect_encoding() can return boolean false, which Zend_PDF::render() does not expect. This causes mb_convert_encoding to fail with Warning: Warning at /www/ZendFramework/library/Zend/Pdf.php:737: mb_convert_encoding() [function.mb-convert-encoding]: Illegal character encoding specified
In my experience improperly encoded PDFs are ubiquitous, so Zend_PDF should be able to handle them instead of expecting the input data to be perfect.
Attached is a patch for how I believe a failed mb_detect_encoding() should be handled, and files to reproduce the problem.
Zend Issue #ZF-7177 also applies here