我正在使用 zip4j 解压缩文件,但文件名 charset 有问题。这是我的代码,
try {
ZipFile zipFile = new ZipFile(source);
if (zipFile.isEncrypted()) {
zipFile.setPassword(password);
}
System.out.println(System.getProperty("file.encoding"));
zipFile.setFileNameCharset("UTF-8");
zipFile.extractAll(destination);
} catch (ZipException e) {
System.out.println(e.getMessage());
}
}
它工作正常,但文件名是这样的