我是否需要将长度超过 72 个字符的电子邮件换行?

发布于 2024-10-04 10:24:36 字数 57 浏览 2 评论 0原文

有时我会看到代码包装电子邮件以确保单行长度不超过 72 个字符。真的有这个必要吗?这到底是怎么回事?

Occasionally I've seen code wrapping email messages to make sure a single line is no more than 72 characters long. Is there really need for this and what is this all about?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猥︴琐丶欲为 2024-10-11 10:24:36

RFC 2822 包含有关行长度的文本,这可能来自:

这有两个限制
标准名额数量
一行中的字符。每一行
字符数不得超过 998
字符,并且应该不超过
78 个字符,不包括 CRLF。

998 个字符的限制是由于
许多实现的局限性
发送、接收或存储互联网
消息格式消息简单
无法处理超过 998 个字符
在一条线上。接收
实施将很好地
处理任意大的数字
一行中的字符数以确保稳健性
清酒。然而,有那么多
实现(符合
与运输要求
[RFC2821]) 不接受消息
包含超过1000个字符
包括每行的 CR 和 LF,它
对于实施很重要
不要创建此类消息。

比较保守的78字符
建议是容纳
用户的许多实现
显示这些的界面
可能被截断的消息,或者
灾难性地换行,显示
每行超过 78 个字符,
尽管事实上这样
实施不符合
本规范的目的
(以及[RFC2821]的,如果他们
实际上导致信息
丢失的)。再说一次,尽管这
对消息进行限制,它
是实施的负担
显示消息

RFC 2822 contains this text about line lengths, which is where this likely comes from:

There are two limits that this
standard places on the number of
characters in a line. Each line of
characters MUST be no more than 998
characters, and SHOULD be no more than
78 characters, excluding the CRLF.

The 998 character limit is due to
limitations in many implementations
which send, receive, or store Internet
Message Format messages that simply
cannot handle more than 998 characters
on a line. Receiving
implementations would do well to
handle an arbitrarily large number
of characters in a line for robustness
sake. However, there are so many
implementations which (in compliance
with the transport requirements of
[RFC2821]) do not accept messages
containing more than 1000 character
including the CR and LF per line, it
is important for implementations
not to create such messages.

The more conservative 78 character
recommendation is to accommodate
the many implementations of user
interfaces that display these
messages which may truncate, or
disastrously wrap, the display of
more than 78 characters per line, in
spite of the fact that such
implementations are non-conformant to
the intent of this specification
(and that of [RFC2821] if they
actually cause information to be
lost). Again, even though this
limitation is put on messages, it
is encumbant upon implementations
which display messages

ゞ记忆︶ㄣ 2024-10-11 10:24:36

为了扩展 Joe 的响应,72 个字符的限制基本上允许正文被引用,因此它为添加到行中的附加字符提供了空间,例如,

From "scratch":
> From Joe Bloggs, 24 Sept 1985
>
> > Probably some flame about emacs vs vi, eulogising one over the other.
> > The quote chars have added four characters to the start of the line, so
> > forcing wrapped lines at 72 chars pushes this to 76 chars, without
> > affecting the formatting of the paragraph.
> 
> Some rant accusing Joe of talking crap, and throwing out some random
> evidence to the contrary. Quote char adds 2 chars. Again, paragraph
> formatting retained.

Someone else chimes in deciding to eulogise pico over either of the
other two editors. All sides about to turn on this person. :-)

因此给出额外的几个字符允许在 80 上保留段落格式-字符终端,至少两个级别,并且可能更多,具体取决于引号字符的添加/使用方式。

To expand on Joe's response, the 72-char limit basically allows for bodies to then be quoted, so it gives room for the additional chars added to a line, e.g.,

From "scratch":
> From Joe Bloggs, 24 Sept 1985
>
> > Probably some flame about emacs vs vi, eulogising one over the other.
> > The quote chars have added four characters to the start of the line, so
> > forcing wrapped lines at 72 chars pushes this to 76 chars, without
> > affecting the formatting of the paragraph.
> 
> Some rant accusing Joe of talking crap, and throwing out some random
> evidence to the contrary. Quote char adds 2 chars. Again, paragraph
> formatting retained.

Someone else chimes in deciding to eulogise pico over either of the
other two editors. All sides about to turn on this person. :-)

So giving an extra few chars allows the parapgraph formatting to be retained on 80-character terminals, for at least two levels, and potentially more depending on how the quote characters are added/used.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文