Menu

#76 zip: UTF-8 GPBF bit 11 is not set if "en_US.UTF-8" locale is not available

v1.0 (example)
open
nobody
None
5
2025-04-22
2025-04-22
No

Hello. This is Debian Bug #918894 and this is the full URL for the bug:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918894

Follows a summary of the bug.

Antonio Cebrián writes:

If the "en_US.UTF-8" locale is not available then the UTF-8 GPBF bit 11 is
not set (incorrectly) without any warning. This produces bad encoding when
decompressing with file-roller and 7z.

The issue can be easily reproduced:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680932#19

Of course, the issue can be solved generating the "en_US.UTF-8" locale:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680932#24

But, perhaps uncommenting the "Could not set Unicode UTF-8 locale" printf
(in main function of files zip.c, zipsplit.c, zipcloak.c and zipnote.c)
would be a good idea:

    if (loc != NULL) {
      /* using UTF-8 character set so can set UTF-8 GPBF bit 11 */
      using_utf8 = 1;
      /*
        printf("  Locale set to %s\n", loc);
      */
    } else {
      /*
        printf("  Could not set Unicode UTF-8 locale\n");
      */
    }
  }

Discussion


Log in to post a comment.