ZipEntry() and converting persian filenames

236 views Asked by At

In my vb.net project I'm trying to add a file with a Persian name to a zip file and I do this with the code bellow:

Dim myentry As New ZipEntry(dr.Item("MyFile").ToString())
zipOut.PutNextEntry(myentry)

however when I open the zip file I see the file name is changed to a gibberish

Is there a way to fix this problem? thanks in advance

1

There are 1 answers

1
VahidN On BEST ANSWER

Try setting IsUnicodeText to true:

'VB.NET
Dim newEntry = New ZipEntry(entryName) With { _
        Key .DateTime = DateTime.Now, _
        Key .Size = size, _
        Key .IsUnicodeText = True _
    }

//C#
var newEntry = new ZipEntry(entryName)
            {
                DateTime = DateTime.Now,
                Size = size,
                IsUnicodeText = true
            };