]> mj.ucw.cz Git - gallery.git/commitdiff
Gallery2: UTF-8-ization
authorMartin Mares <mj@ucw.cz>
Thu, 27 Dec 2012 19:40:33 +0000 (20:40 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 8 Feb 2015 20:14:15 +0000 (21:14 +0100)
gal2/UCW/Gallery.pm
gal2/UCW/Gallery/Web.pm

index d0fedb7f3554a21bf0351c33ef95d4102da8a672..86ebff8a7829897ae1b93aa478f794eb4e6c6f94 100644 (file)
@@ -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;
index 7df0b3ab2155f3601c078f0bb50b50837f2a96ff..ecc2184822743557c2334b71fd6d8023d1e0e524 100644 (file)
@@ -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}};