문제

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

도움이 되었습니까?

해결책

fixed by using quoted_printable_decode() on each line rather than the whole mime-part

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top