From: Martin Mares Date: Tue, 19 Nov 2019 21:16:46 +0000 (+0100) Subject: gal-scan: Assume that local filenames are encoded in UTF-8 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=6a3692681a6b4e342d37f6877fd46e503bcf31c7;p=gallery.git gal-scan: Assume that local filenames are encoded in UTF-8 --- diff --git a/bin/gal-scan b/bin/gal-scan index bb74c06..5fe5f7f 100755 --- a/bin/gal-scan +++ b/bin/gal-scan @@ -6,6 +6,7 @@ use common::sense; use UCW::Gallery; use UCW::Gallery::Hashes; +use Encode; use File::Spec; use Image::EXIF; use Getopt::Long; @@ -46,6 +47,7 @@ if ($update) { opendir D, $in or die "Cannot scan directory $in: $!\n"; my @p = (); while (my $e = readdir D) { + $e = Encode::decode('utf-8', $e); my $f = File::Spec->canonpath(File::Spec->catfile($in, $e)); if ($f =~ m{\.(jpe?g|png)$}i) { push @p, $f;