From a94a26fa7d4c46f63a9b6b6f1dc24283bb4cf83f Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 17 Apr 2013 10:40:07 -0300 Subject: [PATCH] Bug 10068 - Replace the utf8 pragma at C4/Installer.pm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit utf8::encode($string) for Encode::encode('UTF-8',$string) Added Carp and error handling. Sponsored-by: Universidad Nacional de Córdoba --- C4/Installer.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index 5bb9662..73d55fc 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -23,6 +23,7 @@ use strict; our $VERSION = 3.07.00.049; use C4::Context; use C4::Installer::PerlModules; +use Encode; =head1 NAME @@ -156,8 +157,8 @@ sub marc_framework_sql_list { open my $fh, "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt"; my $lines = <$fh>; $lines =~ s/\n|\r/
/g; - use utf8; - utf8::encode($lines) unless ( utf8::is_utf8($lines) ); + + $lines = encode('UTF-8',$lines) unless ( utf8::is_utf8($lines) ); my $mandatory = ($requirelevel =~ /(mandatory|requi|oblig|necess)/i); push @frameworklist, { @@ -234,8 +235,8 @@ sub sample_data_sql_list { open my $fh , "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt"; my $lines = <$fh>; $lines =~ s/\n|\r/
/g; - use utf8; - utf8::encode($lines) unless ( utf8::is_utf8($lines) ); + + $lines = encode('UTF-8',$lines) unless ( utf8::is_utf8($lines) ); my $mandatory = ($requirelevel =~ /(mandatory|requi|oblig|necess)/i); push @frameworklist, { -- 1.7.10.4