In org .commons.ziparchiveentry how to give the filename in foreign languages
In ZipArchiveEntry how to define the filename(files that are zipped have name in the foreign language other than english). When i define
ZipArchiveEntry ze = new ZipArchiveEntry(filename);
It works fine for linux machines but not for windows. please help.
update
Using ZipArchiveEntry i trying to zip the indivdual files with name in foreign language. After zipped i extract the file from that zip. In linux it returns the filename correctly. But in windows filenames are corrupted
The same issue reported while using jdk also.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4244499
http://www.coderanch.com/t/454532/java/java/Corrupt-file-compression
You could get the filename implicitly by using the getEntries method
Enumeration<?> en = zip.getEntries();
ZipArchiveEntry zipEntry = null;
while (en.hasMoreElements()) {
zipEntry = (ZipArchiveEntry) en.nextElement();
}
You can then call getName on zipEntry, to check the name
"i18n name string".equals(zipEntry.getName())
Hope it helps.
链接地址: http://www.djcxy.com/p/66122.html