Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经看过类似主题的答案,但 rfc5322 说:
展开是通过简单地删除紧随 WSP 的任何 CRLF 来完成的。
这可以通过在其中添加空格来破坏源无空格文本。
那么如何折叠没有空格的值?
现代解决方案是使用允许完全任意折叠的 RFC2047 编码:
=?us-ascii?B?A?= =?us-ascii?B?B?=
对单个 string 进行编码AB,保留缺少空格。
AB
标头格式不允许在没有空格的情况下换行。
请注意,发送长行并没有错——标题行的长度限制为 998 个字符(第 2.3 节),如果您需要发送包含超过 998 个字符且没有中间空格的标题,您可能做错了什么.