0

I'm trying to read filename with Swedish characters. When the files are being read I get the exception file not found. The same work for file names without special characters.

I tried with different encoding but still the file names was not being read. Is there a way to handle this

Im running the code on Windows 10.

 using (var zip = new ZipFile())
            {

                zip.AlternateEncoding = Encoding.UTF8;
                zip.AlternateEncodingUsage = Ionic.Zip.ZipOption.Always;
                zip.UseUnicodeAsNecessary = true;
                string filepath = @"C:\Users\username\rel\Reådmeö.txt";

                zip.AddItem(filepath, Path.GetFileName(filepath));


                zip.Save(zipFileSavePath);
            }

following is the error

System.IO.FileNotFoundException: 'That file or directory (C:\Users\username\rel\Reådmeö.txt) does not exist!'

Lance
  • 19
  • 7

0 Answers0