0

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

VahidN
  • 18,457
  • 8
  • 73
  • 117
Sara Nikta Yousefi
  • 1,467
  • 5
  • 21
  • 35

1 Answers1

1

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
            };
VahidN
  • 18,457
  • 8
  • 73
  • 117