Renaming the file to non-english language while adding to zip

May 24, 2012 at 12:15 PM
Edited May 24, 2012 at 12:20 PM

Hi,

I am trying rename the files to non-english languge while adding to zip and wasn't successful.

File names in the zip were corrupted. Here is my sample code.

string[] fileNames = new string[] { "12345.pdf", "12346.pdf" };

            using (ZipFile zip = new ZipFile(System.Text.Encoding.UTF8))
            {

                foreach (string fileName in fileNames)
                {
                    zip.AddFile("C:\\somefolder\\" + fileName).FileName = "non-english file name xxx.pdf";
                }

                zip.Save("C:\\somefolder\\myzipfile.zip");

            }

 

I tried with Unicode as well and had a same problem