Subject: [PATCH] Bug 13304 - Authorised values disappear if it uses diacritics in values

From: Juan Romay Sieira <[email-masked]>
Date: Thu, 20 Nov 2014 09:06:34 +0100

---
 cataloguing/addbiblio.pl |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl
index 5b06706..a9e3d1b 100755
--- a/cataloguing/addbiblio.pl
+++ b/cataloguing/addbiblio.pl
@@ -40,6 +40,7 @@ use Date::Calc qw(Today);
 use MARC::File::USMARC;
 use MARC::File::XML;
 use URI::Escape;
+use Encode;
 
 if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
     MARC::File::XML->default_record_format('UNIMARC');
@@ -234,8 +235,8 @@ sub build_authorized_values_list {
             && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
 
         while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
-            push @authorised_values, $value;
-            $authorised_lib{$value} = $lib;
+            push @authorised_values, Encode::encode_utf8($value);
+            $authorised_lib{Encode::encode_utf8($value)} = $lib;
         }
     }
     $authorised_values_sth->finish;
-- 
1.7.2.5