Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET How to retrieve Unicode file names from ZippedFiles?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19763 |

    Using Xceed Zip .Net v3.3 (registered developer):

    I can see that Unicode file names can be stored in the ExtraHeaders property of a ZippedFile, and this appears to be working since I can see this value being stored when I examine the zip file with a hex editor. I can see both the ASCII file name and the double-byte Unicode file name for each zip entry.

    However, when extracting the zip archive, I’m not sure how to retrieve that Unicode file name from the ExtraHeaders property. Just using the zippedFile.Name returns the ASCII representation of the file name (which will contain ??? where non-english characters exist).

    Would it be something like this?

    ExtraHeaders xHeaders = zippedFile.ExtraHeaders;
    string filename = (string) xHeaders | ExtraHeaders.Unicode;

    or would it be “xHeaders & ExtraHeaders.Unicode”? I’m ignorant when it comes to bitwise operations. I’m also not certain that I have to cast it as a string.

    Thanks for any assistance.

    -Steve

    Imported from legacy forums. Posted by steve (had 2026 views)

    User (Old forums)
    Member
    Post count: 23064

    Nevermind. It turns out that zippedFile.Name is actually returning the unicode version of the file name. Sorry for any confusion!

    Thanks,
    -Steve

    Imported from legacy forums. Posted by steve (had 2951 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.