From fcdc98189e22c412f8725e4fdc79ecf96ee18a34 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 21 Jul 2021 11:24:27 +0200 Subject: [PATCH] Bug 27526: Fix encoding issue on subfield MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you have a "é" subfield it should work! Note that VARCHAR(1) for binary means 1-byte (from MySQL doc): "For example, if the default character set is utf8mb4, CHAR(5) BINARY is treated as CHAR(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin. This differs from BINARY(5), which stores 5-byte binary strings that have the binary character set and collation." Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- cataloguing/additem.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index e2c6e67b46..f5b57d2489 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -51,6 +51,7 @@ use C4::Members; use MARC::File::XML; use URI::Escape qw( uri_escape_utf8 ); +use Encode qw( encode_utf8 ); use MIME::Base64 qw( decode_base64url encode_base64url ); use List::Util qw( first ); use List::MoreUtils qw( any uniq ); @@ -693,7 +694,7 @@ if ($op eq "additem") { my @more_subfields_xml = $input->multi_param("items.more_subfields_xml"); my @unlinked_item_subfields; for my $subfield ( uniq @more_subfields_xml ) { - my @v = $input->multi_param('items.more_subfields_xml_' . $subfield); + my @v = $input->multi_param('items.more_subfields_xml_' . encode_utf8($subfield)); push @unlinked_item_subfields, $subfield, $_ for @v; } if ( @unlinked_item_subfields ) { -- 2.32.0