Discuss (FTP), (FTP on .NET CF) and (FTPS, SFTP and SCP).

GetFileInfos Encoding

no avatar
User

Sentax

Posts

5

Joined

Thu Jan 22, 2009 8:22 am

GetFileInfos Encoding

by Sentax » Wed Aug 12, 2009 5:23 am

Hi there, I've tried searching the forums for my solution, but I can't seem to find out whats wrong.

I've changed the encoding for the FTPConnection:

FTPConnection.DataEncoding = System.Text.Encoding.UTF8

I've tried:

FTPConnection.DataEncoding = System.Text.Encoding.Unicode
FTPConnection.DataEncoding = System.Text.Encoding.GetEncoding("Windows-1252")
FTPConnection.DataEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1")

With no success, the filenames have Latin characters in them and on the server the letters are there, but when I use:

For Each file As EnterpriseDT.Net.Ftp.FTPFile In FTPConnection.GetFileInfos()
Debug.Print(file.Name)
Next

The letters are missing, like it just strips them from the name completely. Why isn't the encoding holding? I've connected with Filezilla Client and the directory listing from the server is fine, as Filezilla Client shows them. It just seems that setting the property for FTPConnection.DataEncoding isn't sticking.

Any ideas?
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: GetFileInfos Encoding

by support2 » Wed Aug 12, 2009 6:47 am

Do you get the same result using GetFiles()?
no avatar
User

Sentax

Posts

5

Joined

Thu Jan 22, 2009 8:22 am

by Sentax » Wed Aug 12, 2009 6:54 am

Thank you for your quick reply.

Yes, sorry for not mentioning it in my original post, I have tried GetFiles:

For Each s As String in FTPConnection.GetFiles()
Debug.Print(s)
Next

Same results.

I even enabled debug at level all and the debug information strips the letters also.
no avatar
User

Sentax

Posts

5

Joined

Thu Jan 22, 2009 8:22 am

by Sentax » Wed Aug 12, 2009 8:51 am

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Thu Aug 13, 2009 10:29 pm

no avatar
User

Sentax

Posts

5

Joined

Thu Jan 22, 2009 8:22 am

by Sentax » Thu Aug 13, 2009 11:52 pm

no avatar
User

Sentax

Posts

5

Joined

Thu Jan 22, 2009 8:22 am

by Sentax » Fri Aug 14, 2009 3:43 am


Who is online

Users browsing this forum: No registered users and 14 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign