From 7431f8cfe29e330e2232b0df591afc4d923b0a52 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 Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- C4/ItemType.pm | 4 ---- admin/item_circulation_alerts.pl | 9 --------- 2 files changed, 13 deletions(-) diff --git a/C4/ItemType.pm b/C4/ItemType.pm index cf61d40cbf..3a15287c85 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 bed078ce0b..d1018c1dd1 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) = @_; -- 2.39.5