ZIP
zip -r --symlinks ../a.zip a a.txt
adding: a/šáčžřŠÁČÝŘŽÚ§/ (stored 0%)
Filename is stored properly in unicode.
LIST
unzip -l ../a.zip
Length Date Time Name
--------- ---------- ----- ----
0 03-11-2021 14:40 a/s??a??c??z??r??S??A??C??Y??R??Z??U??§/
unzip list prints crapy chars.
The filenames are stored in zip correctly in unicode because the unzip restores them properly but I need to show the zip listing in correct unicode chars.
How do I print the listing in correct unicode? Has this anything to do with shell settings?
locale
LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
I'm on MacOS system.
Tried all this, still the same result :-(
LC_ALL=UTF-8 zip...
LC_ALL=UTF-8 unzip...
LANG =UTF-8 zip...
LANG =UTF-8 unzip...
I've also tried all lang variants:
LANG=cs_CZ.UTF-8 unzip -l ../unzip.zip
LANG=en_US.UTF-8 unzip -l ../unzip.zip
All these lang variants are listed in locale -a
and still produce invalid output :-(
bsdtar
works fine without any locale settings.
bsdtar tvvf ../unzip.zip
drwxr-xr-x 0 501 20 0 Mar 11 14:40 a/šáčžřŠÁČÝŘŽÚ§/
Archive Format: ZIP 1.0 (uncompressed), Compression: none
LANG
andLC_ALL
.LC_ALL=UTF-8 unzip ...
would override all the otherLC_
settings, unlikeLANG=UTF-8 unzip ...
. – Stephen Kitt Mar 12 '21 at 08:19bsdtar tvvf file.zip
instead. – Stéphane Chazelas Mar 12 '21 at 08:48