Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P
platform
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 131
    • Issues 131
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • simantics
  • platform
  • Issues
  • #656

Closed
Open
Opened Dec 08, 2020 by Marko Luukkainen@luukkainenOwner

Using default UTF-8 charset for uncompressing zip files does not work in all cases.

We have a zip file that current FileUtils.extractZip is not able to handle:

java.lang.IllegalArgumentException: MALFORMED
	at java.util.zip.ZipCoder.toString(ZipCoder.java:58)
	at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:300)
	at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:122)
	at org.simantics.utils.FileUtils.extractZip(FileUtils.java:905)
	at org.simantics.utils.FileUtils.extractZip(FileUtils.java:857)

By visual inspection, the file does not contain any exotic characters. Recompressing the content with 7-Zip or Windows file manager does not help. Accorinding to this https://stackoverflow.com/questions/20013091/java-unzip-error-malformed , using some other charsets could fix the issue.

With the problematic file, using ISO_8859_1 charset allows uncompressing the zip file correctly.

Edited Dec 08, 2020 by Marko Luukkainen
Assignee
Assign to
1.43.1
Milestone
1.43.1
Assign milestone
Time tracking
None
Due date
None
Reference: simantics/platform#656