From d60b69a25f747b18f024752a380a3d2e9fe9b5cf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 14 May 2014 11:20:21 +0200 Subject: [PATCH] Bug 11944: Fix encoding issue in C4::ItemType There is no need to encode strings coming from DB. To reproduce: go on admin/item_circulation_alerts.pl The headers contain bad encoded characters. Signed-off-by: Dobrica Pavlinusic --- C4/ItemType.pm | 4 ---- admin/item_circulation_alerts.pl | 9 --------- 2 files changed, 0 insertions(+), 13 deletions(-) diff --git a/C4/ItemType.pm b/C4/ItemType.pm index cf61d40..3a15287 100644 --- a/C4/ItemType.pm +++ b/C4/ItemType.pm @@ -82,7 +82,6 @@ sub all { for ( @{$dbh->selectall_arrayref( "SELECT * FROM itemtypes ORDER BY description", { Slice => {} })} ) { - $_->{description} = Encode::encode('UTF-8', $_->{description}); push @itypes, $class->new($_); } return @itypes; @@ -105,9 +104,6 @@ sub get { my $data = $dbh->selectrow_hashref( "SELECT * FROM itemtypes WHERE itemtype = ?", undef, $itemtype ); - if ( $data->{description} ) { - $data->{description} = Encode::encode('UTF-8', $data->{description}); - } return $class->new($data); } diff --git a/admin/item_circulation_alerts.pl b/admin/item_circulation_alerts.pl index bed078c..d1018c1 100755 --- a/admin/item_circulation_alerts.pl +++ b/admin/item_circulation_alerts.pl @@ -35,15 +35,6 @@ use C4::Output; # shortcut for long package name our $preferences = 'C4::ItemCirculationAlertPreference'; -# utf8 filter -sub utf8 { - my ($data, @keys) = @_; - for (@keys) { - $data->{$_} = decode('utf8', $data->{$_}); - } - $data; -} - # prepend "br_" to column name and replace spaces with "
" sub br { my ($data, @keys) = @_; -- 1.7.2.5