mime 解码 pdf 引用-可打印
我一直在构建一个简单的票证系统,除了通过电子邮件接收使用 quoted-printable
编码发送的 PDF 文件时,一切都已完成并正常工作。我尝试使用 quoted_printable_decode()
,即 quoted-printable.decode
流过滤器,后者只是创建了一个空文件。我还尝试过使用 $input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input) 。
但是PDF文件总是无法读取。我将原始版本与重建版本进行了比较,发现有很多 00
丢失,并且替换了一些其他字符。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过在每一行而不是整个 mime 部分使用
quoted_printable_decode()
来修复fixed by using
quoted_printable_decode()
on each line rather than the whole mime-part