Skip to content

test/parallel/test-zlib-zip-interop.js fails if system's zipinfo is built without natspec #66975

Description

@LiviaMedeiros

The non-ascii filename unicode-名前.txt is decoded as unicode-??????.txt so this assertion:

assert.ok(zipinfo.stdout.toString().includes(name), `zipinfo missing ${name}`);

consistently fails with:

  AssertionError [ERR_ASSERTION]: zipinfo missing unicode-名前.txt

Activity

  1. ravi-arnan commented on Oct 24, 2026

    @ravi-arnan

    I can reproduce this on Linux (NixOS).

    Cause

    Stock Info-ZIP zipinfo replaces non-ASCII bytes with ? in fnfilter() unless patched with wide-character/UTF-8 printing support (such as USE_NATSPEC or alt-iconv-utf8-print). While unzip -v reports UNICODE_SUPPORT, stock builds still sanitize non-ASCII bytes to ?, so zipinfo outputs unicode-??.txt (or unicode-??????.txt) instead of unicode-名前.txt, failing the assertion.

    Proposed fix

    When inspecting zipinfo output, if a non-ASCII entry is not found verbatim, check whether zipinfo listed the entry with ? replacement placeholders. (Full UTF-8 extraction and file integrity are already verified by the bsdtar step).

    I have a patch prepared with lint and tests verified. Working on a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions