OS: Windows,
默认编码(eclipse上设置的是UTF-8)
我当前没有使用zipfile,而是使用了zInputStream,出现的问题是MalForm(形式不对)。
解决方法就是增加Charset
ZipInputStream zis=new ZipInputStream(fis, Charset.forName("gbk"));
参考:
1 http://bugs.java.com/view_bug.do?bug_id=4820807
2 http://docs.oracle.com/javase/7/docs/api/java/util/zip/ZipInputStream.html
文档中提到
public ZipInputStream(InputStream in)
Creates a new ZIP input stream.
The UTF-8 charset
is used to decode the entry names.
-
Parameters:
-
in
- the actual input stream