]> mj.ucw.cz Git - gallery.git/commitdiff
gal-scan: Assume that local filenames are encoded in UTF-8
authorMartin Mares <mj@ucw.cz>
Tue, 19 Nov 2019 21:16:46 +0000 (22:16 +0100)
committerMartin Mares <mj@ucw.cz>
Tue, 19 Nov 2019 21:16:46 +0000 (22:16 +0100)
bin/gal-scan

index bb74c06c5c5f77f5a3ac6f6e6f2deb34b7383ce5..5fe5f7fcfc2f1374db97c36703f65d508b46f2be 100755 (executable)
@@ -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;