Mime Multipart消息ContentId"CID:"的有效字符是什么? [英] What are the valid characters for a Mime Multipart message ContentId "CID:"?

查看:218
本文介绍了Mime Multipart消息ContentId"CID:"的有效字符是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过阅读RFC可以看出,CID只能/必须包含与常规URI允许的字符相同的字符集.这样对吗.我问是因为我想编写一个简单的帮助程序,该帮助程序带有CID前缀,并在为mime多类型附件生成CID时添加一个计数器.

From reading the RFC it appears that CID can/must only contain characters from the same set as those permissable by a regular URI. Is this correct. Im asking because I wish to writeup a simple helper that takes a CIDs prefix and adds a counter when generating CID for mime multitypes attachments.

推荐答案

Content-ID值必须采用RFC-822 addr-spec(user @ domain)的形式.

The Content-ID value is required to be in the form of an RFC-822 addr-spec (user@domain).

由于addr-spec可能包含URL中不允许的字符,因此在"cid" URL中使用时,这些字符将进行十六进制编码.

Since an addr-spec may contain characters not allowed in a URL, those characters are hex-encoded when used in the "cid" URL.

根据RFC2392:

"cid" URL转换为 相应的Content-ID消息 标头[MIME],由
删除"cid:"前缀,将%编码的字符转换为 他们的等价物 US-ASCII字符,并用斜角将其余部分括起来 括号对, <"和>".

A "cid" URL is converted to the corresponding Content-ID message header [MIME] by
removing the "cid:" prefix, converting the % encoded character to their equivalent US-ASCII characters, and enclosing the remaining parts with an angle bracket pair, "<" and ">".

了解更多: http://www.faqs.org/rfcs/rfc2392.html

这篇关于Mime Multipart消息ContentId"CID:"的有效字符是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆