I have a problem with files with a Unicode name in Zip. I am using vjslib.dll. in a normal scenario, it's working perfect but when I am trying to zip file which has a Unicode character name like "サンプルファイル.pdf"it's represented as a "???????.pdf", in zip file while extracting a zip file Unicode file name nane represent as a "_______.pdf" is there any way to generate a zip with the exact name of the file does not matter file name in English or another language
zipFileName = "c:\SampleZip\myfile.zip"
sourceFile
- c:\sample\サンプルファイル.pdf
c:\sample\отличается.xml
private void Zip(string zipFileName, string[] sourceFile) { FileOutputStream filOpStrm = new FileOutputStream(zipFileName); ZipOutputStream zipOpStrm = new ZipOutputStream(filOpStrm); FileInputStream filIpStrm = null; foreach (string strFilName in sourceFile) { filIpStrm = new FileInputStream(strFilName); ZipEntry ze = new ZipEntry(Path.GetFileName(strFilName)); zipOpStrm.putNextEntry(ze); sbyte[] buffer = new sbyte[1024]; int len = 0; while ((len = filIpStrm.read(buffer)) >= 0) { zipOpStrm.write(buffer, 0, len); } } zipOpStrm.closeEntry(); filIpStrm.close(); zipOpStrm.close(); filOpStrm.close(); }