gpt4 book ai didi

email - 为什么 “-”(连字符)是电子邮件兼容性的唯一 ASCII 限制?

转载 作者:行者123 更新时间:2023-12-04 12:16:22 25 4
gpt4 key购买 nike

我正在阅读这个 proposal for Base91 ,(我添加了粗体格式):

All the SMTP-based E-mail can provide compatibility with the E-mail. So-called compatibility with the E-mail is to transform arbitrary 8-bit data byte-strings or arbitrary bit stream data transferred by the E-mail into a character-strings of a limited ASCII. The main limitation on the latter is that:
(a) the characters have to be printable;
(b) the characters are not control character or “-” (hyphen).
There are totally 94 of such ASCII characters, their corresponding digital coding being all integers ranging from 32 through 126 with the exception of 45. E-mail written in these ASCII characters is compatible with the Internet standard SMTP, and can be transferred in nearly all the E-mail systems.



注意:45 是连字符的 ASCII 值。
注意:我刚刚发现这个提案来源于中国的专利(ZL00112884.1)和 US (US6859151B2)

但是我也阅读了有关 SMTP 的 RFC 5321,但我找不到任何使连字符成为可打印 ASCII 范围的唯一限制的内容。

注意:可打印的 ASCII 范围是:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

为什么 Base91 提案/专利声称“-”(连字符)是电子邮件兼容性的唯一限制?

最佳答案

看起来连字符用作多行 SMTP 消息中的控制/标记字符。

RFC5321 4.2.1 Reply Code Severities and Theory :

The format for multiline replies requires that every line, except the last, begin with the reply code, followed immediately by a hyphen, "-" (also known as minus), followed by text. The last line will begin with the reply code, followed immediately by <SP>, optionally some text, and <CRLF>. As noted above, servers SHOULD send the <SP> if subsequent text is not sent, but clients MUST be prepared for it to be omitted.



Base91 提案使用 SMTP 作为其应用和限制的示例。正如您所说,它最初想使用 94 个字符,但由于各种标准(例如 SMTP),它排除了常用的伪控制字符(“-”、“.”、“=”)。它使用 SMTP 是因为它证明了 Base91 编码的实用性(例如,对每个字符编码 13 位数据而不是使用 Base64 编码 6 位可以大大减少编码任何给定消息所需的位数),此外还承认它使用了连字符作为控制字符不会在 Base91 文本中造成歧义。

任何文本都可以用 Base91 编码——该论文指出它将 13 位数据映射为两个可打印的 ASCII 字符。任何数字、任何字符(包括换行符)都可以由 Base91 编码,类似于任何字符可以由 Base64 编码的方式。同样,此映射可以反转,以从 Base91 编码生成原始输出。

这是一个多行 SMTP 回复代码示例:
  250-First line
250-Second line
250-234 Text beginning with numbers
250 The last line

在此示例中,它将包含连字符、换行符和数字的大型多行 SMTP 邮件转换为某种 Base91 编码形式。如果此编码形式包含伪控制字符(例如连字符),则 SMTP 客户端可能会将 Base91 编码的数据解释为格式错误的 SMTP 数据。从Base91字符集中删除连字符等字符的目的是 不是 由于 SMTP 的缺陷或 SMTP 本身的规范,使用和解析 SMTP 数据的客户端,并确保客户端仍然可以正确接受 Base91 数据,而不会将其误解析为 SMTP 数据的风险。

关于email - 为什么 “-”(连字符)是电子邮件兼容性的唯一 ASCII 限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50674623/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com