commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damiano Albani (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COMPRESS-429) Expose whether ZIP entry name & comment come from Unicode extra field
Date Mon, 20 Nov 2017 16:00:06 GMT

    [ https://issues.apache.org/jira/browse/COMPRESS-429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16259402#comment-16259402
] 

Damiano Albani commented on COMPRESS-429:
-----------------------------------------

Oh, I wasn't aware of the issues related to WinZip, it's nice to know.
Yet, I don't think that one faulty implementation is a reason to dismiss the whole idea of
Unicode name / comment as defined in the standard.

I have posted my code as pull request, so you can see what kind of changes I am proposing:
https://github.com/apache/commons-compress/pull/56.
But now that you mention the EFS flag, I suppose {{hasUnicodeName}} should be set when this
flag is set, right?
My goal here is not to introduce some new whizz-bang functionality but only to provide a _shortcut_
method showing how reliable the value returned by {{ZipArchiveEntry::getName}} is.

> Expose whether ZIP entry name & comment come from Unicode extra field
> ---------------------------------------------------------------------
>
>                 Key: COMPRESS-429
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-429
>             Project: Commons Compress
>          Issue Type: Improvement
>            Reporter: Damiano Albani
>            Priority: Minor
>              Labels: Unicode, ZIP
>
> 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.:
> {noformat}
> boolean hasUnicodeName
> boolean hasUnicodeComment
> {noformat}
> 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?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message