Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

September 19, 2007

What is the Charset in FTP2’s PutFileFromTextData Method?

The FTP2 component’s PutFileFromTextData allows a program to upload the contents of a string variable directly to a remote file on an FTP server. In many programming environments, strings are Unicode (such as with .NET’s C# and VB.NET). The question is: Do you want your text file on the FTP server to be Unicode (i.e. 2 bytes / character)? Probably not. You’re probably expecting it to be ANSI (1 byte/char) . You may pass "ANSI" for the charset property. This causes the string to be converted to ANSI before being uploaded to the FTP server. You can also be very specific about what character encoding you want to use, so you may pass any charset name, such as "iso-8859-1″, "utf-8″, "shift_JIS", "iso-2022-jp", "euc-kr", "windows-1255″, etc. As long as the characters in the string have representations in the charset specified, your string will be converted and uploaded. Of course, 99% of the time you’ll simply pass "ANSI" because that’s by far the most common need.


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.