mime decode pdf quoted-printable

Posted by TonyVipros on Stack Overflow See other posts from Stack Overflow or by TonyVipros
Published on 2010-06-18T08:45:50Z Indexed on 2010/06/18 8:53 UTC
Read the original article Hit count: 669

Filed under:
|
|

Hi,

I've been building a simple ticket system and it's all done and working except for when it receives PDF files via email that have been sent using quoted-printable encoding. I've tried using quoted_printable_decode(), the quoted-printable.decode stream filter, the later just created an empty file. I've also tried using $input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input).

However the PDF file is always unreadable. I've compared the original with the rebuilt version and there are a lot of 00 missing and some other characters replaced.

original file

rebuilt file

© Stack Overflow or respective owner

Related posts about php

Related posts about encoding