From 15c94ea825e89d418f40cb5ad4b82082a11e674c 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." --- cataloguing/additem.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 0212b0d4c72..7ad0ad94458 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 ); @@ -692,7 +693,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.20.1