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

character encodingftp

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!

Best Answer

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.)

Related Question