如果我使用包含变音字符的文件(例如1-2GF-969 ##JÖN.pdf)的zip文件运行以下程序,我会收到IllegalArgumentException。
我的应用程序必须支持所有语言。所以,我们将编码设置为UTF-8
所有语言都运行良好。但是阅读变音字符时会出现问题。
我尝试使用zip输入流的替代方法,比如arcmexer,但它不支持中文字符。
请帮助我。
private static void readUsingJava() {
ZipInputStream zis;
try {
zis = new ZipInputStream(new FileInputStream("C:\\Check.zip"));
ZipEntry ze;
while ((ze = zis.getNextEntry()) != null) {
System.out.println("Name of the File Is :: " + ze.getName());
}
zis.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}