Reasoning behing 76 being the line length limit for MIME sections, as defined by RFC 2045?

后端 未结 4 1693
情深已故
情深已故 2021-01-17 08:52

RFC 2045 defines the maxmimum line length for encoded data as 76 - however I cannot find any explanation as to why it is 76. Is this number entirely arbitrary, or is there s

4条回答
  •  清歌不尽
    2021-01-17 09:32

    The maximum line length of 80 including the terminating carriage return and line feed originates from the good old punch cards which contained up to 80 colums of holes.
    Why 80? Because in any book, a line is rarely longer than 80 characters including spaces.
    It implied a maximum line length of 80 including the terminating Carriage Return (which moved the carriage of the teletype or typing machine to the leftmost position) and Line Feed (which advanced the paper by one line).
    Since Base64 is in multiples of 4 characters, we end up with a maximum of 76, not counting CR+LF.
    Another example is the TLE (Two-Line Element set) which describes a satellite's orbit. It fits on just two punch cards.
    Since CR (horizontal movement to the leftmost, maintaining the vertical position) and LF (vertical movement to next line, keeping the horizontal position as is) are two fully independent things, we still have both of them. The next line should start at the leftmost position, shouldn't it?
    For printing in bold, a line was printed twice with only a CR between them, i.e. without advancing the paper. Therefore the standard sequence is CR first and then LF.
    However, the good old mechanical typing machine usually did the LF first and then the CR.

提交回复
热议问题