Batch item/record modification/deletion tools does not open uploaded
files in utf-8
Test plan:
Edit and delete records and items using a file which will contain:
valid and invalid barcodes with and without utf-8 chars (💕)
You should see the warning message:
"The ***
39999000💕001679 does not exist in the database."
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
my @contentlist;
if ($filefh){
+ binmode $filefh, ':encoding(UTF-8)';
while (my $content=<$filefh>){
$content =~ s/[\r\n]*$//;
push @contentlist, $content if $content;
$recordtype = 'biblio';
} elsif ( my $uploadfile = $input->param('uploadfile') ) {
# A file of id is given
+ binmode $uploadfile, ':encoding(UTF-8)';
while ( my $content = <$uploadfile> ) {
next unless $content;
$content =~ s/[\r\n]*$//;
$recordtype = 'biblio';
} elsif ( my $uploadfile = $input->param('uploadfile') ) {
# A file of id is given
+ binmode $uploadfile, ':encoding(UTF-8)';
while ( my $content = <$uploadfile> ) {
next unless $content;
$content =~ s/[\r\n]*$//;