C# Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C# Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

Unicode Filenames in Zip Archives

Download: Chilkat .NET Assemblies

This example discusses how to handle Unicode filenames in Zip archives.

/*
The NTFS filesystem supports Unicode, so filenames in any language are supported. 
However, the Zip file standard is only capable of supporting a single language at 
a time (i.e. a single OEM code page). If your computer's default OEM code page is 
different than the language of the filename, then you would need to set the 
Zip.OemCodePage property to the correct value.

        ' Here is a list of OEM code pages:
        ' 437 OEM - United States 
        ' 737 OEM - Greek (formerly 437G) 
        ' 775 OEM - Baltic
        ' 850 OEM - Multilingual Latin I 
        ' 852 OEM - Latin II 
        ' 855 OEM - Cyrillic (primarily Russian) 
        ' 857 OEM - Turkish
        ' 858 OEM - Multlingual Latin I + Euro symbol 
        ' 860 OEM - Portuguese
        ' 861 OEM - Icelandic
        ' 862 OEM - Hebrew
        ' 863 OEM - Canadian - French
        ' 864 OEM - Arabic
        ' 865 OEM - Nordic
        ' 866 OEM - Russian
        ' 869 OEM - Modern Greek 
        ' 874 ANSI/OEM - Thai (same as 28605, ISO 8859-15) 
        ' 932 ANSI/OEM - Japanese, Shift-JIS 
        ' 936 ANSI/OEM - Simplified Chinese (PRC, Singapore) 
        ' 949 ANSI/OEM - Korean (Unified Hangeul Code) 
        ' 950 ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC)  

*/
	    private void button8_Click(object sender, System.EventArgs e)
	    {
		    Chilkat.Zip zip = new Chilkat.Zip();
		    zip.UnlockComponent("anything for 30-day trial");
		    
		    zip.OemCodePage = 874;
		    
		    zip.NewZip("thaiFilenames.zip");
		    
		    zip.AppendFromDir = "c:/temp";
		    zip.AppendFiles("thaiNamed/*",true);
		    
		    // The zip in this example contains a file named:
		    // ฉันกินกระจก.txt
		    
		    // If unzipping on a Thai computer (where the default code page
		    // is Windows-874) it will unzip correctly.
		    zip.WriteZipAndClose();
	    }

	    private void button9_Click(object sender, System.EventArgs e)
	    {
		Chilkat.Zip zip = new Chilkat.Zip();
		zip.UnlockComponent("anything for 30-day trial");
		
		// Chilkat Zip can unzip .zip files with filenames in any language
		// on any locale by setting the OemCodePage.    
		zip.OemCodePage = 874;
		    
		zip.OpenZip("thaiFilenames.zip");
		
		// This unzips correctly on any computer in any locale.
		zip.Unzip("./thaiFilenames");
			    
	    }

Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/csharp/step2.asp

 

© 2000-2012 Chilkat Software, Inc. All Rights Reserved.

Email Component · XML Parser