http://qs321.pair.com?node_id=198656


in reply to Re: Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...
in thread Handling Mac, Unix, Win/DOS newlines at readtime...

Let me quote RFC 2068 (HTTP/1.1), from the section on the relationship between HTTP and MIME:

19.4.1 Conversion to Canonical Form

MIME requires that an Internet mail entity be converted to canonical form prior to being transferred. Section 3.7.1 of this document describes the forms allowed for subtypes of the "text" media type when transmitted over HTTP. MIME requires that content with a type of "text" represent line breaks as CRLF and forbids the use of CR or LF outside of line break sequences. HTTP allows CRLF, bare CR, and bare LF to indicate a line break within text content when a message is transmitted over HTTP.

Where it is possible, a proxy or gateway from HTTP to a strict MIME environment SHOULD translate all line breaks within the text media types described in section 3.7.1 of this document to the MIME canonical form of CRLF. Note, however, that this may be complicated by the presence of a Content-Encoding and by the fact that HTTP allows the use of some character sets which do not use octets 13 and 10 to represent CR and LF, as is the case for some multi-byte character sets.

Notice the "SHOULD" and "Where it is possible".
  • Comment on Re: Re: Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...
by Fastolfe (Vicar) on Sep 17, 2002 at 21:33 UTC

    Yep, you're right. See my other reply also. This surprises me, in a way. The only way this relaxed requirement makes sense to me is in a case where the HTTP server isn't sure what line endings are being used on textual content stored on the server, which is an example of someone making special concessions because something else isn't doing what it's supposed to.

    So basically, HTML says, "I should be CRLF when sent over the Internet," but HTTP says, "Err, yah, we'll see what we can do."

    :/