• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to unzip for files containing umlauts  RSS feed

 
K Anshul
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a piece of Java code which unzips a zip file. The file names could contain umlauts.



this code is unable to process the umlaut characters and throws IllegalArgumentException error. If there are no umlauts in the file name it works fine.

We are using Java 6 and
http://bugs.java.com/view_bug.do?bug_id=4820807 says it’s a Java bug which is fixed in version 7.

We are unable to use Java7 as it's not yet certified within the organization.

Is there any other way to get around this problem?

Thanks in anticipation.
 
Stephan van Hulst
Saloon Keeper
Posts: 7973
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For ZipInputStream, no.

Your best bet is to either convert the file before using it, or simply not to use files that contain entries with umlauts.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just some workaround ideas (however, I've not tried out any of them for your scenario):

1) Use Apache commons Compress package (http://commons.apache.org/proper/commons-compress/zip.html). It's Apache licensed, so hopefully your company's bureaucracy won't have a problem with it.


2) Take the java 7 zip package source code from OpenJDK 7 project, rename package and incorporate into your application. However, since OpenJDK 7 is GPL licensed, your bureaucrats may have some issues with it.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!