Zip file with special chars are not unzipped properly

Hi all,
i have following problem: I want to unzip a zip file. In the zip file there is a file with a special character i.e. "straße". When i call now zipFile.getInputStream( entry ) null will be returned. What can i do? Thanks a lot
ZipFile zipFile = new ZipFile( file );
    Enumeration enumeration = zipFile.entries();
    while ( enumeration.hasMoreElements() )
      ZipEntry entry = ( ZipEntry ) enumeration.nextElement();
      if ( !entry.isDirectory() )
        InputStream in = null;
        OutputStream out = null;
        try
          in = zipFile.getInputStream( entry );  //<- Here null will be returned When i look at the entry the "ß" of "straße" is represented by á.

May be you need to specify an ecoding for ZipEntry that would allow special characters?

Similar Messages

  • I opened an email with a zip file with virus, it could not unzipped but is my lap top infected?

    is true an apple lap top can't get virus?

    It can get a virus if there were one designed for OS X. However, a Windows virus cannot affect it. Never open files sent by email unless you know the source.
    Helpful Links Regarding Malware Protection
    An excellent link to read is Tom Reed's Mac Malware Guide.
    For adware removal see The Safe Mac » Adware Removal Guide and The Safe Mac » Adware Removal Tool.
    Also, visit The XLab FAQs and read Detecting and avoiding malware and spyware.
    See these Apple articles:
      Mac OS X Snow Leopard and malware detection
      OS X Lion- Protect your Mac from malware
      OS X Mountain Lion- Protect your Mac from malware
      OS X Mavericks- Protect your Mac from malware
      About file quarantine in OS X
    If you require anti-virus protection Thomas Reed recommends using ClamXAV. (Thank you to Thomas Reed for this recommendation.)
    From user Joe Bailey comes this equally useful advice:
    The facts are:
    1. There is no anti-malware software that can detect 100% of the malware out there.
    2. There is no anti-malware that can detect anything targeting the Mac because there
         is no Mac malware in the wild, and therefore, no "signatures" to detect.
    3. The very best way to prevent the most attacks is for you as the user to be aware that
         the most successful malware attacks rely on very sophisticated social engineering
         techniques preying on human avarice, ****, and fear.
    4. Internet popups saying the FBI, NSA, Microsoft, your ISP has detected malware on
        your computer is intended to entice you to install their malware thinking it is a
        protection against malware.
    5. Some of the anti-malware products on the market are worse than the malware
        from which they purport to protect you.
    6. Be cautious where you go on the internet.
    7. Only download anything from sites you know are safe.
    8. Avoid links you receive in email, always be suspicious even if you get something
        you think is from a friend, but you were not expecting.
    9. If there is any question in your mind, then assume it is malware.

  • Hi there, Fn + F1 to F12 special features are not working properly in bootcamp Windows

    Hi there, I m just wondering recently my keyboard special features keys are not working properly(fn   F1 to F12). Is there any solutions for this?? For example I cant switch the brightness with fn   F1.. THis is so troublesome.... Please help! thanks
    This was working fine in the early stage until recently which is not functioned properly.. ANy way to fix this up?? Thanks!

    I had tried them...but its all good now... Guess RegPro must be delete my bootcamp item..So I just redownload them n reinstall...all back to normal!...THANKS!

  • Messages with zip files or multiple attachments are not being delivered

    Has anyone else come across this? I've discovered that files sent from my .mac account are not being delivered if they contain zip files or multiple attachment. A single .docx file goes through, but multiple doc files or a single zip file do not.
    I get no error message, and neither does the recipient. The message sends on my end but simply doesn't show up on their end.
    Any thoughts on what might be causing this?

    Another follow-up: Now, for whatever reason, even attachments of a single document aren't going through.
    Again, I'm receiving no error message, and it shows up in my sent folder. It just never makes it to the recipient.
    This is very frustrating, and makes my iCloud mail account all but useless. Does anyone have any idea at all what might be happening?

  • Problem with zipping file with chinese chars

    I need to zip a html page which contains some chinese characters, I am able to zip it and create a zip file
    but the problem is when i open the zip file and view the html file it displays junk characters instead
    of chinese characters
    Here is what i am doing
      ByteArrayOutputStream bStream = new ByteArrayOutputStream();
       ZipOutputStream zStream = new ZipOutputStream(bStream);
        ZipEntry zipEntry = new ZipEntry(htmlFilename);
        zStream.putNextEntry(zipEntry);
        ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
        PrintWriter writer = new PrintWriter(
                               new OutputStreamWriter(dataStream,"UTF-8"));
    writer.write(htmlString); //htmlString is the string which contents the html contents which has chinese char
        writer.close();
    zStream.write(dataStream..toByteArray());

    And when you view the unzipped file, are you using something that realizes that you encoded your data using UTF-8? My guess is that you are not.
    PC&#178;

  • Special Char are not allowing

    Hi all,
    here i am facing the problem while activating the DSO...
    the error was Value " ºu0152Öݱ±u0178©CA1715" from characteristic 0ALLOC_NMBR contains an error
    we have given in RSKC --> ALL_CAPITAL_PLUS_HEX and ALL_CAPITAL also     
    this 0ALLOC_NMBR  is 1 to 1 in mapping transformations...
    Thanks In advance

    Hi all,
    Thank you for all your replies...
    But i need those spcial char's  in the CUBE ,because my Customer wants to see those values in the report level...
    If i select thaose special  char and put it in RSKC..my problem will not resolve...because like that we have somany for example :
    Ë°ÎñŽúÀí·Ñ       
    u0153áת±u0178Ô³ö¿Ú12%Ë°
    u0153áת±u0178ÔÂÏúÏîË°u0153ð 
    u0153áת±u0178ÔÂÏúÏîË°u0153ð 
    ºu0152²£ÍÁµØʹÓ÷Ѡ  
    ŽÖÉŽÊֲᲹ˰     
    ¹úÄÚÔËÊä±£·Ñ     
    Ôu20ACÌá¹úÄÚÔË·Ñ     
    u0152ÆÌá±u0178Ô³ö¿ÚÔË·Ñ 
    ÍÁµØʹÓÃË°       
    u0152u0152Êõ·þÎñ·Ñ   PL  
    09.1.1-6.30ѧ·Ñ  
    help me out...
    Thanks in advance...

  • How to save string in a file with special-chars

    Hello,
    i´m usingthe MD5-llb to create a password.
    Then i  want to save this MD5-string to a file and later read it back abd compare.
    Works perfect with one proplem:
    Some word create a "\r" in the MD5-string and when i save this string to a file and read it back then its read back as a "\n" so that the compare is not working.
    My question is: How can i save a string exactly like it is to somewhere and read it back (also invisible chars)
    For example the word: heinz
    is in MD5: \r\FB^\07\A6\07T\C7\D9\C2\94\AB\C9\1DS\95 (string indicator as codes display)
    when i save the string to a file then i rerad back: \n\FB^\07\A6\07T\C7\D9\C2\94\AB\C9\1DS\95
    I used the "write text file" and "read text file"
    What do i have to use to save and read the same?
    Thx
    Solved!
    Go to Solution.

    I believe an MD5 hash is 16 bytes long. Use the binary read and write file I/O functions and specify the length of the data to be read or written.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Properties with special characters are not transfered to system properties

    A property which contains a special character like % or � (o with 2 dots above) will not passed to system properties in java 1.5.0_16.
    This was working with java 1.5.0_06.
    Example
    Jnlp:
        <property name="test.fail" value="M�ller"/>
        <property name="test.works" value="Moller"/>java:
    System.getProperty("test.fail") = null
    System.getProperty("test.works") = "Moller"The Jnlp is correct encoded in UTF-8
    Are there any ideas?
    regards

    <property name="test.fail" value="M&#37;ller"/>

  • How to repeatedly replace different strings with most chars are Not unique?

    NOTE: I'm trying to avoid to do a substring of a substring of a ... replacement.
    Hello there,
    I'm looking for solution on a best approach to do a string replacment in something like example below.
    The idea would be to:
    1. Open a file and Find a "Title" (i.e. TC162-01.2GFC (after <td colspan=6>)). The Title here will be a dynamic and can be changed from one run to another.
    2. If it match to expected value then do a replacement of data between <select... and </select> for another values.
    3. Keep going for each block of <tr> ... </tr>
    =======================================
    <tr>
    <td colspan=1>1</td>
    <td colspan=1>TC1.1</td>
    <td colspan=6>TC162-01.2GFC</td>
    <td colspan=2>Unknown</td>
    <td colspan=1><select name="res_1_0_20789_21522" size=1>
    <option>PASS</option><option>FAIL</option><option selected>No Status</option></select> </td>
    <td colspan=1><input type=text maxlength='30' size='10' name='comment_1' value=''></td></tr>
    <tr>
    <td colspan=1>2</td>
    <td colspan=1>TC1.2</td>
    <td colspan=6>TC162-01.3ABC</td>
    <td colspan=2>Unknown</td>
    <td colspan=1><select name="res_2_0_20790_21523" size=1>
    <option selected>PASS</option><option>FAIL</option><option>No Status</option></select> </td>
    <td colspan=1><input type=text maxlength='30' size='10' name='comment_2' value=''></td></tr>
    =======================================

    Here's a simple and conceptual example. You could use your real implementation of the getReplace() method.
    /** file: test-vlad.txt *************************************
    <tr>
    <td colspan=1>1</td>
    <td colspan=1>TC1.1</td>
    <td colspan=6>TC162-01.2GFC</td>
    <td colspan=2>Unknown</td>
    <td colspan=1><select name="res_1_0_20789_21522" size=1>
    <option>PASS</option><option>FAIL</option><option selected>No Status</option></select> </td>
    <td colspan=1><input type=text maxlength='30' size='10' name='comment_1' value=''></td></tr>
    <tr>
    <td colspan=1>2</td>
    <td colspan=1>TC1.2</td>
    <td colspan=6>TC162-01.3ABC</td>
    <td colspan=2>Unknown</td>
    <td colspan=1><select name="res_2_0_20790_21523" size=1>
    <option selected>PASS</option><option>FAIL</option><option>No Status</option></select> </td>
    <td colspan=1><input type=text maxlength='30' size='10' name='comment_2' value=''></td></tr>
    import java.util.regex.*;
    import java.io.*;
    public class Vlad{
      public static void main(String[] args) throws Exception{
        BufferedReader br;
        StringBuffer sb;
        String line, fcontent;
        sb = new StringBuffer();
        br = new BufferedReader(new FileReader("test-vlad.txt"));
        while ((line = br.readLine()) != null){
          sb.append(line + "\n");
        fcontent = sb.toString();
        String regex
         = "<td colspan=6>([^<]+)(</td>.+?<select[^>]+>)(.+?)</select>";
        Pattern pat = Pattern.compile(regex, Pattern.DOTALL);
        Matcher mat = pat.matcher(fcontent);
        StringBuffer rsb = new StringBuffer();
        while (mat.find()){
          String title = mat.group(1);
          String value = mat.group(3);
          String newValue = getReplace(title, value);
          mat.appendReplacement
            (rsb, "<td colspan=6>" + title + "$2" + newValue + "</select>");
        mat.appendTail(rsb);
        System.out.println(rsb.toString());
      } // end main()
      // a dummy implementation
      static String getReplace(String tdTitle, String selectValue){
        return "###ANOTHER VALUES###";
    }Edited by: hiwa on Dec 11, 2007 11:14 AM

  • Special characters are not showing properly in FF.

    I am developing an website where user can input special characters like '¥' or '╩' like this. I have to store these value to DB and wold display it from DB. When I try to fetch these value from DB, it looks like '�'. I am using <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> in my jsp page. This is working fine in Chrome, problem occurs with FF only. Please help.

    Are you serving the page fully formed, or inserting the characters into the page from an XMLHttpRequest? Could you post a link to a page demonstrating the problem?

  • While saving multiple attachments from mail, files with same name are added and not replaced

    While saving Multiple Attachments from Mail, existing file with same name are not overwritted but new files are added in the folder.

    Bjørn Larsen a écrit:
    Hi all
    Hope to get some help with Elements Organizer.
    I have 12-15 years of digital photos that I now want to import into my newly aquirede Adobe Elements Organizer / Photoshop. Since my Nikon names the files with continous numbers from 0001 to 9999 I have multiple files with the same name although they are not alike at all. My previous software had no problems with that since I keep the photos in separate file folders based on import date. I generally import photos after each event and so name the folder with the date and some event info (e.g. 2014.12.24 - Christmas at grandparents).
    That is a common situation, I have the same limitation for files not going over 9999 on my Canons...
    Now - when I import my photos into Elements Organizer I get a lot of error messages with "same name exist .....) Hmmmmmmm
    Please sate the exact wording of the error message, I have never seen a message stating 'same name exist...' or equivalent; only messages about files already in the catalog. Files already in the catalog mean that some files have the same 'date taken' and file size in Kb.
    Any suggestions. I'm using a mac and tried to rename files based on date taken. The mac can do that but it takes ages to go into each folder and run the renaming script there.
    I also use a similar folder creation scheme (such a date naming is the default for the downloader). That way I never get a message about duplicates for the same file names.
    However - I can't be the first or only person with this problem so I figure that some workaround must be known out there. Maybe the import action can recognize date taken or - well. Thank you very much in advance if you can help me out here.
    You can alsways set the downloader to rename the imported files with a unique new name, there are many options in the 'advanced' dialog of the downloader. I don't know about Macs, but I don't thing there is a difference.

  • Can you share files in the cloud with people who are not on the team?

    Just wondering if you can share files with people that are not on the team. The paid for team members.

    They have not upgraded to iOS 5

  • Zip.ZipInputStream cannot extract files with Chinese chars in name

    Dear friends,
    Peace b upon u!
    I am trying to read a zip file (~3000 files)containing one
    or more files with Chinese, Japanese or Korean names, the
    getNextEntry method throws an IllegalArgumentException as below after extracting just ~300 files as below:-
    java.lang.IllegalArgumentException
            at java.util.zip.ZipInputStream.getUTF8String(Unknown Source)
            at java.util.zip.ZipInputStream.readLOC(Unknown Source)
            at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
            at testZipFiles.getZipFiles(testZipFiles.java:65)
            at testZipFiles.main(testZipFiles.java:18) issue:java.util.zip.ZipInputStream cannot extract files with Chinese chars in name
    Category java:classes_util_jarzip
    Plz let me know 1 of the ways which I can solve this issue.
    1)if someone has JAVA DCOMPILER plz send the SOURCE Code
    for the ZipInputStream.class to me..I need to edit it using 1 of the solutions as provided below which I googled.
    2)If there is an alternate or upgraded java.util.zip.ZipInputStream or any org.apache.tools.zip.* package which can read such files..If yes where I can download the same on net.
    3)Any other easier solution, which can let me extract all files (by excluding Chinese files thru CATCH) without the extractor process to fail altogether.
    On net I found that the only solution with this is:-
    - edit the new ZipEntry, remove the static initializer that calls
    the native methods initIDs().
    this step seems a bit scary, but it's according to the
    workaround
    to bug #4244499 (the workaround of Olive64, THU JUN 05
    01:55 P.M. 2003),
    that handles a similar bug at the ZipOutputStream.
    Now you have a ZipInputStream that supports multi-bytes
    entry names.
    to extract the zip file, using the fixed code that is offered
    above,
    create a function that gets an "encoding" string, a "destPath"
    string
    and a "sourceFile" (zipped) and does :
    ZipInputStream zipinputstream = null;
    ZipEntry zipentry;
    zipinputstream = new ZipInputStream(new FileInputStream
    (sourceFile),encoding);
    zipentry = zipinputstream.getNextEntry();
    while (zipentry != null) { //for each entry to be extracted
        String entryName = zipentry.getName();
        int n;
        FileOutputStream fileoutputstream = new FileOutputStream
    ( destPath + entryName );
        while ((n = zipinputstream.read(buf, 0, 1024)) > -1)
            fileoutputstream.write(buf, 0, n);
        fileoutputstream.close();
        zipinputstream.closeEntry();
        zipentry = zipinputstream.getNextEntry();
    }//while
    zipinputstream.close();

    Hi friend,
    We'd better to ask one question in each thread. If you have another issue, you can consider to open up a new thread in this forum.
    Now for the first question, do you mean this picture? It throws access exception in archive2.
    If so , because your extractPath is a path, not a directory.You should add +"xxx.zip". For more information, please refer to
    ZipFile.Open
    Method (String, ZipArchiveMode).
    For the second question, you can use the following code to skip the error message.
    while (true)
    try
    //do something;
    catch (Exception ex)
    { continue; }
    Good day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Pull a zip file with multiple files unzip it, and finally load one of the f

    Hi Aill,
    I have following query.
    Could we do the following with XI: pull a zip file with multiple files from a vendor which resides outside of XI server network, unzip it, and finally load one of the files to SAP?
    Regards
    Rohan S

    Hi Varadharajan,
    I have 10 text files in some ZIP file on one server which is out side of network. We can reach that file through Proxy only to read ZIP file.
    I need to extract the file and on the bases of some condition one of the file i need to upload data to SAP.
    Is it possible. If possible then How?
    Regards

  • I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it.

    I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it. All of the files are going into the same zip file but I want them visually in the space that I put them and not at the bottom of the snap to grid folder location they are looking like.  I am trying to  drag and drop files in groups so that I can group them for now, but image files always do their own "sort by" when I drag them from my web pages. Links don't do it though.  I tried resetting the folder, and deleting the DS files. No luck.

    You keep asking variants on this same question. You've had replies in all your other threads. If you can't find them, go here and click where it says Activity:
    Thomas Cannon Jr.

Maybe you are looking for

  • SOAP Adapter Error with HTTPS

    Guys, I have created one SOAP Adapter Receiver as a configuration below: Target URL = https://www.server.com/ws.asmx (example) Configure Certificate Athenticate (i have use one certificate configured in key store from Visual Admin) Configura Proxy (i

  • Crossover cable needed to connect Switch to Airport?

    I need more ports. I got more stuff to hook up than available ports on the Airport. I picked up a switch but couldn't find anything in the boards on whether a crossover or straight-through cable is required to connect the two. I suspect the Airport p

  • Infa Error: Data source name not found and no default driver specified

    All, Infa version 8.1, DAC 795. Plain vannila installation with SQL server. Both client and server installed in same machine. DAC connectivity both with infa and oltp working fine. When ETL is run, Informatica session logs are giving following error:

  • View audio wave form in A1 and A2 etc in the timeline instead of the Viewer

    It's likely this is an amateur question buuut - Is there anyway to get the audio wave form to show in the Audio layers in the timeline. The only way I've seen to adjust and play with audio is when I double click on one of the tracks and then the audi

  • Importing Business Catalyst Site

    Using CS 6 I'm trying to import a Business Catalyst site of one of my clients. When I go to Site Manager in Dreamweaver and click on 'import business catalyst' I get the following message... An account with the same email already exists in Business C