I added a fix and some tests but ToNetASCIIOutputStream in commons-util will always replace to \r\n so I'm uploading a modified version. With this fix ascii mode should not eat line separators anymore.
2009/5/26 Niklas Gustavsson <nik...@protocol7.com>: > On Tue, May 26, 2009 at 12:38 PM, Sai Pullabhotla > <sai.pullabho...@jmethods.com> wrote: >>>> when FtpServer receives a file in ASCII mode our current code replaces \r >> for \r\n and ignores \n, but since it seems FileZilla >>>> doesn't transform new lines to \r\n we will never find a \r and the new >> line characters will be silently ignored. >> >> Hmm... shouldn't it be just doing the following: >> >> 1. Replace \r\n with System.getProperty("line.separator"); >> 2. Write everything else as is. > > Agreed. However, that's not what we currently do since if the client > only sends \n we will strip out the line ending. This is a bug on our > side that we should fix. You can probably agrue that FileZilla is > doing the right thing as \r is probably not to be regarded as the > "internal character representation" (as described in the RFC) on > Windows. > > Anyways, we should add a bunch of tests for this and fix. > > /niklas >