From ab6456d2b88575e5bb0a790e6a9dd48d77a7d6f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ji=C5=99=C3=AD=20Setni=C4=8Dka?= Date: Sat, 3 Nov 2018 20:32:20 +0100 Subject: [PATCH] Fix hashing of non-ASCII file names --- lib/UCW/Gallery/Hashes.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/UCW/Gallery/Hashes.pm b/lib/UCW/Gallery/Hashes.pm index 233fabb..f27241f 100644 --- a/lib/UCW/Gallery/Hashes.pm +++ b/lib/UCW/Gallery/Hashes.pm @@ -7,6 +7,7 @@ use common::sense; use File::stat (); use Digest::SHA; +use Encode; sub new { my ($class, $gal) = @_; @@ -37,7 +38,7 @@ sub hash_image { my $st = File::stat::stat($path) or die "Cannot access $path: $!\n"; my $key_text = join(":", $path, $st->dev, $st->ino, $st->mtime); - my $key = Digest::SHA->sha1_base64($key_text); + my $key = Digest::SHA->sha1_base64(Encode::encode_utf8($key_text)); if (!exists $cache->{$key}) { my $sha = Digest::SHA->new(1); -- 2.39.5