Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no results when using unpack with Charset #95

Open
yummish opened this issue Sep 13, 2017 · 2 comments
Open

no results when using unpack with Charset #95

yummish opened this issue Sep 13, 2017 · 2 comments

Comments

@yummish
Copy link

yummish commented Sep 13, 2017

We have many zips encoded with GBK or GB1314, etc. When I use unpack(inputstream, target, charsetName..), the result is empty and there is exception thrown.

If I don't specify the charset, then it's saying it's malformed.

@yummish
Copy link
Author

yummish commented Sep 13, 2017

Well, the process was:

  1. Download file to local
  2. Get file inputstream
  3. pass to unpack

I tried to pass the file directly and it works:

  1. Download the file to local
  2. pass file to unpack

@toomasr
Copy link
Contributor

toomasr commented Sep 13, 2017

So if you use byte[] bytes = ZipUtil.unpack(new File("/tmp/demo.zip"), "foo.txt", Charset.forName("yourCharset")); it works but when you open the InputStream yourself and call ZipUtil.unpack(InputStream is, File outputDir) it fails?

Do you open the InputStream with the correct encoding? Can you share the code that works and the code which doesn't? And if you feel this is a zt-zip issue can you provide with an archive to test with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants