代码之家  ›  专栏  ›  技术社区  ›  Tower

我需要在一行中包装超过72个字符的电子邮件吗?

  •  9
  • Tower  · 技术社区  · 15 年前

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

    2 回复  |  直到 15 年前
        1
  •  5
  •   Callie J    15 年前

    为了扩展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个字符的终端上保留副图格式,至少保留两个级别,而且可能更依赖于如何添加/使用引号字符。

        2
  •  8
  •   Joe    15 年前

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

    这有两个限制 数量上的标准位置
    一行中的字符。每行 字符不能超过998 字符,且不应超过 78个字符,不包括CRLF。

    998个字符的限制是由于 许多实现中的限制
    发送、接收或存储Internet的 消息格式消息 不能处理超过998个字符 在一条线上。接收
    实现可以很好地 处理任意大的数
    为了稳健性,行中的字符数 目的。但是,有那么多 实施(符合 根据运输要求 [RFC2821])不接受消息 包含超过1000个字符 包括每行的CR和LF 对实现很重要 不创建这样的消息。

    更保守的78字 建议是
    用户的许多实现 显示这些
    可能截断的消息,或 灾难性的包装,展示
    每行超过78个字符 尽管事实上
    实现不符合 本规范的目的 (以及[RFC2821]的 实际上导致信息 丢失)。再说一次,即使这样 限制是对消息的,它 阻碍了实现 显示消息的