Open chenxiaolong opened 3 months ago
Hey @chenxiaolong
the encoding.pm
module is a standard with all versions of Perl that this script supports (5.10.0 or greater) so you shouldn't have to install anything extra.
What platform are you running? What version of Perl do you have?
Have you a non-standard install by any chance that didn't include encoding.pm
?
Oh, interesting. I'm using perl 5.38.2 on Fedora 40.
It seems there may be 2 encoding.pm
files:
❯ sudo dnf provides '*/encoding.pm'
...
perl-encoding-4:3.00-505.fc40.x86_64 : Write your Perl script in non-ASCII or non-UTF-8
Repo : @System
Matched from:
Filename : /usr/lib64/perl5/vendor_perl/encoding.pm
...
perl-libs-4:5.38.2-506.fc40.x86_64 : The libraries for the perl run-time
Repo : @System
Matched from:
Filename : /usr/lib64/perl5/PerlIO/encoding.pm
...
The perl-encoding package is built from this module:
❯ rpm -qi perl-encoding | grep ^URL
URL : https://metacpan.org/release/Encode
I'm not sure if Fedora does something different, but it looks like the encoding::_get_locale_encoding()
and Encode::find_encoding()
functions used in zipdetails only exists in the encoding.pm
file from the perl-encoding
package.
Does installing that package sort the issue?
Yep, it does.
Yep, it does.
Good stuff. Ping me if you have any other issues.
When the perl encoding library isn't installed, for some of my zip files, if I run
zipdetails -vv <file>
, it fails with:I did some debugging and it seems like the
eval
ingetNativeLocale
is eating the error. If I comment out theeval
, then I get:It wasn't clear to me before that I had to install this library.
I'm unsure if the encoding library is meant to be an optional or required dependency. If it's a required dependency, is there a way to avoid suppressing the error (or alternatively, could the dependency be documented)?
Thanks!
(I'm using commit 66f376c946e4cbefe7b587461434b91476f8f2f9.)