From issues-return-65722-archive-asf-public=cust-asf.ponee.io@commons.apache.org Sun Jan 7 10:24:06 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id E6079180654 for ; Sun, 7 Jan 2018 10:24:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D6A01160C29; Sun, 7 Jan 2018 09:24:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 269A1160C17 for ; Sun, 7 Jan 2018 10:24:06 +0100 (CET) Received: (qmail 55870 invoked by uid 500); 7 Jan 2018 09:24:05 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 55859 invoked by uid 99); 7 Jan 2018 09:24:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Jan 2018 09:24:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8975A180633 for ; Sun, 7 Jan 2018 09:24:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -107.911 X-Spam-Level: X-Spam-Status: No, score=-107.911 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Jg8gBUyG0Zzp for ; Sun, 7 Jan 2018 09:24:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 951E45FB2E for ; Sun, 7 Jan 2018 09:24:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 16112E2584 for ; Sun, 7 Jan 2018 09:24:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 34E9E240FE for ; Sun, 7 Jan 2018 09:24:00 +0000 (UTC) Date: Sun, 7 Jan 2018 09:24:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COMPRESS-429) Expose whether ZIP entry name & comment come from Unicode extra field MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COMPRESS-429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16315121#comment-16315121 ] ASF GitHub Bot commented on COMPRESS-429: ----------------------------------------- Github user bodewig commented on a diff in the pull request: https://github.com/apache/commons-compress/pull/56#discussion_r160044269 --- Diff: src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java --- @@ -239,6 +239,7 @@ static void setNameAndCommentFromExtraFields(final ZipArchiveEntry ze, originalNameBytes); if (newName != null && !originalName.equals(newName)) { --- End diff -- I think the second part is there for a reason, even though my memory is failing me right now - and I stumbled over it myself when I realized the same check is not present for the comment. I understand what you mean, though, changed with c2906092 > 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 > Fix For: 1.16 > > > 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)