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

System.Text.Encoding

no avatar
User

y2kdis

Posts

5

Joined

Fri Jan 22, 2010 12:04 am

System.Text.Encoding

by y2kdis » Fri Jan 29, 2010 11:40 am

What's the safest encoding to use in my case? I only have any combination of the ff. characters:
1. alphanumeric
2. underscore
3. white space
4. period
5. single-quote.
I wasn't specifying a commandencoding at first and I found out that those files with special characters (for example, TIMOTHY_O'NEAL_123456_M.doc) will not go through.
I ran some tests and I had success with System.Text.Encoding.Default, or System.Text.Encoding.GetEncoding("Windows-1252"), or System.Text.Encoding.GetEncoding("ISO-8859-1")
although I am not sure which one is best for me as I am not familiar with this.
All the machines involved like the pc where the file was created, the server, and the client machine are Windows-based if that will help.

Also, do I have to specify the commandencoding for the ftpconnection control everytime I connect to the ftpserver or I can do it only once and it will stick?
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: System.Text.Encoding

by support2 » Mon Feb 01, 2010 10:58 pm

Windows-1252 should be fine for you (very similar to 8859-1).

You only have to set the property once for a connection object.

Who is online

Users browsing this forum: No registered users and 15 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign