Characters encoding is one of the most frustrating problems for me. When I first used edtFTPnet and saw the ControlEncoding and DataEncoding stuff, I knew you guys really have a clue on it and I really hope edtFTPnet can fully solve the problem. Thanks for the great work! edtFTPnet really rocks!
I did a further test and here is the result.
Test case:
Source:
Windows Vista English Edition
Default Code page for non-Unicode program: 1252 (English)
Filenames w/ Chinese characters are stored in NTFS (thus, these filenames are stored as Unicode)
Site1:
Linux Fedora 6 English Edition
EXT3
All default setting, thus, should be pure English.
Use FileZilla(runs on English Vista) to upload/download to: Won't work.
(a) Success!
FtpClient.ControlEncoding set to CP950 (Traditional Chinese)
Username: testuser, Password: 123456
FtpClient.Connect() --> OK
FtpClient.Login("testuser", "123456") --> OK
Get Dir Listing... --> Both English and Chinese filenames looks correct. OK.
Sucessfully transferred entire folders and sub-folders.
(b)
FtpClient.ControlEncoding set to UTF8
Username: testuser, Password: 123456
FtpClient.Connect() --> OK
FtpClient.Login("testuser", "123456") --> Exception: Please login with USER and PASS. (code=530)
Get Dir Listing... --> Don't have a chance to execute.
Site2:
Windows XP Pro Traiditioal Chinsese Edition
NTFS
Default Code page for non-Unicode program: 950 (Traditional Chinese)
FTP Server: FIlezilla Server
Use FileZilla(runs on English Vista) to upload/download: Works!
(a)
FtpClient.ControlEncoding set to CP950 (Traditional Chinese)
Username: testuser, Password: 123456
FtpClient.Connect() --> OK
FtpClient.Login("testuser", "123456") --> OK
Get Dir Listing... Chinese filenames NOT OK, got strange folder names. and when use the strange folder names to list sub-folders, exception: Directory not found. (code=550)
(b)
FtpClient.ControlEncoding set to UTF8
FtpClient.Connect() --> OK
FtpClient.Login("testuser", "123456") --> FAIL, exception: Syntax error, command unrecognized. (code=500)
Get Dir Listing... Don't have a chance to execute.
(c)
FtpClient.ControlEncoding set to CP1252 (English)
Manual change dir listing's encoding to UTF8
Username: testuser, Password: 123456
FtpClient.Connect() --> OK
FtpClient.Login("testuser", "123456") --> OK
Get Dir Listing... Engllish filenames OK, Chinese filenames NOT OK, but no exception. just received invliad filenames
(d) Success!
FtpClient.ControlEncoding set to CP950 (Traditional Chinese)
Manual change dir listing's encoding to UTF8
Username: testuser, Password: 123456
FtpClient.Connect() --> OK
FtpClient.Login("testuser", "123456") --> OK
Get Dir Listing... OK
Sucessfully transferred entire folders and sub-folders.
I am no FTP expert. Base on above tests, I guess FTP commands cannot be encoded as UTF8 right? And Filezilla server (and I guess most servers do) seems just return the orinial filenames in its origial encoding.
Not sure if I am providing useful information, please let me know if I can help to investigate the issue.