When commands are sent thru the FTPControlSocket that contains file and directory names with non-ASCII characters, these characters are changed to something else and therfore causing errors. In my case, the connection to the FTP server was shut down.
This is because the StreamWriter and StreamReader uses the US-ASCII encoding, FTPControlSocket.cs on line 287-288:
writer = new StreamWriter(stream, Encoding.GetEncoding("US-ASCII"));
reader = new StreamReader(stream, Encoding.GetEncoding("US-ASCII"));
In order to fix the problem, and be able to send non-ascii characters in the control stream a different encoding has to be used.
When testing I found that Encoding.UTF8, Encoding.Unicode will not work. But "Windows-1252" will work.
So the lines above (FTPControlSocket.cs:287-288) has to be changed to:
writer = new StreamWriter(stream, Encoding.GetEncoding(1252));
reader = new StreamReader(stream, Encoding.GetEncoding(1252));
This will allow ASCII characters plus the most common Western European characters to pass thru, i.e. it will widen the set of allowed characters. See
http://en.wikipedia.org/wiki/Windows-1252.
BUT, it will still not allow all filenames. For example the file name "عكתּ.txt" cannot be used.
(Generating non ASCII-filenames can be made thru the "Character Map" application found on the Start menu.)
So, the fix is better than using the US-ASCII encoding, but not enough. Since the FTP RFC only states that NVT-ASCII should be supported it might be hard to find a encoding that works with all servers. The best would be to let the user change the encoding on the FTPClient object, defaulting to US-ASCII.