Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-429

Expose whether ZIP entry name & comment come from Unicode extra field

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.16
    • Component/s: Archivers
    • Labels:

      Description

      It is known fact that detecting the encoding of the name/comment of ZIP entries is a messy process. And that the general purpose bit 11 is often unreliable.
      Only the so-called Unicode extra field (if present) can be trusted to reliably determine a ZIP entry name & comment, as far as I understand.

      But the current API of Commons Compress doesn't (easily) expose in which situation the ZIP archive reader is.
      That's why I propose to add a couple of new getter/setter-exposed fields to ZipArchiveEntry, e.g.:

      boolean hasUnicodeName
      boolean hasUnicodeComment
      

      This way it can be easily determined if the value returned by ZipArchiveEntry::getName or ZipArchiveEntry::getComment can be trusted. Or if it needs some "character encoding sniffing" of sorts.

      What do you think?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dalbani Damiano Albani
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: