检测消息字符串是否是 QP 编码的
在 FreeBsd 系统上,我试图确定 ac 样式字符串形式的电子邮件是否经过 qp 编码?
是否有像 iconv 这样的 unix 工具可以读取数据块并输出检测到的编码?像字符集检测?
有什么想法吗?
On FreeBsd system, i am trying to determine if an email message in the form of a c style string is qp encoded?
Is there a unix tool like iconv which can read in chunk of data and output the detected encoding? like charset detection?
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,您应该从数据源获取此信息。引用的可打印数据应始终如此标记。没有 100% 确定的方法可以确定数据是 QP,因为 QP 的关键属性是它是有效的纯 ASCII 文本。如果数据包含许多 =XX 序列,并且不包含 QP 中的任何无效内容(例如高字节),那么它可能旨在作为 QP,但这就是您能做的最好的事情。
Really, you should get this information from the source of the data. Quoted-printable data should always be flagged as such. There's no 100% certain way to determine that data is QP since the key property of QP is that it's valid plain ASCII text. If the data contains a number of =XX sequences, and doesn't contain anything invalid in QP (like high bytes), then it's probably intended as QP, but that's about the best you can do.
您查看 Content-Transfer-Encoding 标头字段。请参阅 http://en.wikipedia.org/wiki/MIME 作为起点,包括链接至规格。
You look at the Content-Transfer-Encoding header field. See http://en.wikipedia.org/wiki/MIME for a starting point, including links to specifications.