Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.8k views
in .NET FTP by (200 points)
I'm brazilian, and as you might know the portuguese language has specifics graphemes, such as "

5 Answers

0 votes
by (162k points)
You need to set the CommandEncoding property.
0 votes
by (200 points)
I tried every available type and each time I got a different and weird error. Here is a snippet:

            
ftpClient.ControlEncoding = Encoding.UTF8;
ftpClient.Connect(...);
ftpClient.Login(...);

string[] ftpFiles = ftpCliente.Dir("");
for (int i = 0; i < ftpFiles.Length; i++)
{
       DateTime x = ftpClient.ModTime(ftpFiles[i]);
}


With no ControlEncoding declaration, the ftpFiles array gives me the name of the files already with the missing accents, so when accessing ModTime(ftpFiles[i]) I receive the error "The system cannot find the file specified"

With UTF8 declaration, I get a "USER xxx: command not understood"
With UTF7 declaration, "The system cannot find the file specified"
UTF32, "Unexpected null reply received"

am I doing it right?
0 votes
by (162k points)
Unfortunately this depends on the server and you have to experiment.

Try Encoding.GetEncoding(1252)
0 votes
by (200 points)
CommandEncoding is the same as ControlEncoding property? because there is no such thing as CommandEncoding
0 votes
by (162k points)
yes, my mistake

CommandEncoding is the same as ControlEncoding property? because there is no such thing as CommandEncoding

Categories

...