Downloading files with filezilla result in newline \r\n\n

4

This is one thing that has been annoying me for sometime.

For some files, whenever I download them via Filezilla, and opening them up in Eclipise/Dreamweaver IDE, it will result in double line spacing. On the server, it is single line-spacing, and in Notepad as well.

Checking a hex editor, it seems that the newlines got mangled. Instead of

\r\n

or just a

\r

I get a \r\n\n

And I have to use the hex editor to fix the problem. Any ideas what may be wrong here? Maybe some settings in Filezilla?

Thanks!

Extrakun

Posted 2009-09-11T08:00:16.970

Reputation: 377

Answers

5

Unix, Windows and Mac systems all have their own newline characters. When transferring files as ASCII, most FTP clients convert these newlines if applicable. So: one could set up Filezilla to handle text files as ASCII.

However, it seems that the newlines in the files on the server do not match the operating system of that server. Hence, when using automatic conversion, things get messed up. So, like @Manni suggested: you need to ensure all files are handled as "binary", not as ASCII.

(Note that many other files, such as program files, Word documents, music and images always need to be transferred as "binary", to ensure no automatic conversion is done.)

Arjan

Posted 2009-09-11T08:00:16.970

Reputation: 29 084

My recommendation would have been the exact opposite: tell your client to handle all files as binary so it won't mess with them. – innaM – 2009-09-11T08:20:51.563

Ah, I missed the "\r\r\n" – Arjan – 2009-09-11T08:23:20.187