Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
Zip with Unicode Filenames
The NTFS filesystem supports Unicode and filenames can contain characters in any language. 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 prior to appending files.
Here is a list of OEM code pages: LOCAL loZip LOCAL lnSuccess LOCAL loZip2 * This example creates a .zip with filenames containing * Chinese characters. Using Chilkat Zip, the .zip can * be created and unzipped on any locale computer. However, * to unzip using a program such as WinZip, it must run * on a computer with the correct locale. loZip = CreateObject('Chilkat.Zip2') * Any string unlocks the component for the 1st 30-days. lnSuccess = loZip.UnlockComponent("Anything for 30-day trial") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loZip.LastErrorText) QUIT ENDIF loZip.NewZip("chinese.zip") * Set the OEM code page to Chinese Big5 loZip.OemCodePage = 950 * Add references to all files under a "chinese" subdirectory. * This directory will contain filenames having Chinese characters. loZip.AppendFiles("chinese",1) lnSuccess = loZip.WriteZipAndClose() IF (lnSuccess <> 1) THEN =MESSAGEBOX(loZip.LastErrorText) QUIT ENDIF * Create a new instance of a zip object. Load the .zip * we previously created and unzip to another directory. loZip2 = CreateObject('Chilkat.Zip2') * Don't forget to set the OEM code page... loZip2.OemCodePage = 950 lnSuccess = loZip2.OpenZip("chinese.zip") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loZip2.LastErrorText) QUIT ENDIF * This will unzip correctly on any locale computer. lnSuccess = loZip2.Unzip("outDir") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loZip2.LastErrorText) ELSE =MESSAGEBOX("unzipped!") ENDIF |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser