MobileChromeApps / cordova-plugin-zip

Zip plugin for Cordova apps
Other
168 stars 207 forks source link

unzip error when file name contain Chinese name #57

Open chen4342024 opened 8 years ago

chen4342024 commented 8 years ago

unzip error when file name contain Chinese name, How do I solve this problem.

sin-bufan commented 8 years ago

i think it is because gbk charset is not supported. i tried to modify Zip.java use ZipInputStream zis = new ZipInputStream(inputStream, Charset.forName("GBK")); to replace ZipInputStream zis = new ZipInputStream(inputStream);

but get compile error. my java SDK is 1.8, and from 1.7, ZipInputStream did support the second parameter.

Akkora commented 7 years ago

@sin-bufan i got it to work with Charset.forName("Cp437") for german special characters. I had to update the java version to 7, else it wouldn't compile. This was done by building for android 6.0 devices which support java 7. Java 7 supports the second parameter (charset) and the build is successfull.