cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Text files sent binary using libcurl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 22 Aug 2001 10:12:07 +0200 (MET DST)

On Tue, 21 Aug 2001, Carlson, John wrote:

(I'm CC'ing this to the libcurl mailing list, which is probably a better list
to talk about development with libcurl.)

> When I look at the file, after bringing it back manually from the WEB
> server to an NT system, it has no CR/LF at the end of the lines. So it
> looks like it was sent binary to the WEB server.

This lead me to do some research into the FTP land (RFC959 section 3.1.1.1 to
be specific). The quesion is, who is responsible for the ASCII conversion?

  The sender converts the data from an internal character representation to
  the standard 8-bit NVT-ASCII representation (see the Telnet specification).
  The receiver will convert the data from the standard form to his own
  internal form.

The sender, that is libcurl, should convert the stream to "the standard 8-bit
NVT-ASCII representation". Well, libcurl doesn't do that! :-O

I *suspect* that you can get the CRLF conversion working by setting the
not-so-often-used option CURLOPT_CRLF.

I'm adding this to the TODO. I wonder why I didn't discover this before? If
you're up to it, I would appriciate patches that offer this feature...

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-08-22