Bug 8215 follow-up encoding for branches & itemtypes
authorPaul Poulain <paul.poulain@biblibre.com>
Fri, 28 Sep 2012 14:45:37 +0000 (16:45 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 21 May 2013 22:50:56 +0000 (15:50 -0700)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Corinne Bulac <corinne.hayet@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Koha/Template/Plugin/Branches.pm
Koha/Template/Plugin/ItemTypes.pm

index ad768a5..e201ff7 100644 (file)
@@ -21,6 +21,7 @@ use Modern::Perl;
 
 use Template::Plugin;
 use base qw( Template::Plugin );
+use Encode qw{encode decode};
 
 use C4::Koha;
 
@@ -31,7 +32,7 @@ sub GetName {
     my $sth   = C4::Context->dbh->prepare($query);
     $sth->execute($branchcode);
     my $b = $sth->fetchrow_hashref();
-    return $b->{'branchname'};
+    return encode('UTF-8', $b->{'branchname'});
 }
 
 1;
index 60ca979..abccbf4 100644 (file)
@@ -21,6 +21,7 @@ use Modern::Perl;
 
 use Template::Plugin;
 use base qw( Template::Plugin );
+use Encode qw{encode decode};
 
 use C4::Koha;
 
@@ -31,7 +32,7 @@ sub GetDescription {
     my $sth   = C4::Context->dbh->prepare($query);
     $sth->execute($itemtype);
     my $d = $sth->fetchrow_hashref();
-    return $d->{'description'};
+    return encode('UTF-8', $d->{'description'});
 
 }