From 69478d4c1a6d316184419fe80f7c4e6130026d03 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 27 Dec 2012 20:40:33 +0100 Subject: [PATCH] Gallery2: UTF-8-ization --- gal2/UCW/Gallery.pm | 2 +- gal2/UCW/Gallery/Web.pm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gal2/UCW/Gallery.pm b/gal2/UCW/Gallery.pm index d0fedb7..86ebff8 100644 --- a/gal2/UCW/Gallery.pm +++ b/gal2/UCW/Gallery.pm @@ -118,7 +118,7 @@ sub write_list($$$) { sub read_list($$) { my ($self, $file) = @_; my @images = (); - open my $fh, '<', $file or return; + open my $fh, '<:utf8', $file or return; while (<$fh>) { chomp; /^$/ and next; diff --git a/gal2/UCW/Gallery/Web.pm b/gal2/UCW/Gallery/Web.pm index 7df0b3a..ecc2184 100644 --- a/gal2/UCW/Gallery/Web.pm +++ b/gal2/UCW/Gallery/Web.pm @@ -112,6 +112,7 @@ sub show_list($) { sub dispatch($) { my ($self) = @_; + binmode STDOUT, ':utf8'; UCW::CGI::parse_args(\%args); $self->{meta} = $self->{gal}->read_meta(File::Spec->catfile($self->get('CacheDir'), 'cache.meta')); $self->{num_photos} = scalar @{$self->{meta}->{sequence}}; -- 2.39.2