Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using the FTP command I transferred an xml file from a Red Hat Enterprise Linux box which happens to be in Europe to another RHEL box in the United States. I didn't specify a transfer mode so it defaulted to ASCII which as far as I understand shouldn't ever translate characters between two Linux boxes, but it did. The file size grew at the destination and vim reported it as a DOS file. I checked and LANG=en_US.UTF-8 on both machines.

Anyone have a clue why this character translation happened?

share|improve this question

migrated from Mar 1 '10 at 21:34

This question came from our site for professional and enthusiast programmers.

That's exactly what ASCII mode does. It translates line ends.

If you don't want that, simply switch to BINARY mode, which transfers the data as-is without any transformation.

These days you hardly ever want ASCII mode at all. Especially not for XML files.

share|improve this answer
I think the point here is that it was two Linux boxes. Why would it translate the line endings to DOS format? – Troubadour Mar 1 '10 at 21:20
@Troubadour:using <CRLF> for line endings predates DOS. RFC 765 specified it for text mode ftp in 1980, roughly a year before the IBM PC first hit the market. – Jerry Coffin Mar 1 '10 at 21:28
Yes, that was the point of the question. – Steve Prior Mar 1 '10 at 21:28

RFC 959 says that when sending in ASCII mode, the sending side must send the file in a "standard form" with CRLF line-ends, and the "receiver will convert the data from the standard form to his own internal form." (See section, ASCII Type.)

So it appears that in your case, the sending side sent the file with CRLF line-ends because the FTP protocol requires it, and the receiving side is keeping them for some reason.

I found the following page that says by default, the FTP server in Red Hat Enterprise Linux 3 and 4 pretends to allow ASCII mode, but preforms a binary transfer anyway: Why does the vsftp FTP server fail to transfer a file in ASCII mode when ASCII mode has been set by the FTP client in Red Hat Enterprise Linux 3 and 4?

So that might explain why it's keeping the CRLF line-ends.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.