From 8eebce8a71775b5f9d6079644e9153a482534f0c Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour Date: Fri, 11 Feb 2022 17:57:57 +0100 Subject: [PATCH] Fix handling of utf-8 chars --- html/Admin/CustomFields/ImportValues.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/Admin/CustomFields/ImportValues.html b/html/Admin/CustomFields/ImportValues.html index 6a197e2..b6426fb 100644 --- a/html/Admin/CustomFields/ImportValues.html +++ b/html/Admin/CustomFields/ImportValues.html @@ -93,10 +93,10 @@ if ( $ARGS{Cancel} ) { push @results, "Importing ". $filename; my $fh = $cgi_object->upload($name); if ( $fh ) { - binmode($fh); + binmode($fh, ":utf8"); require Text::CSV; - my $csv = Text::CSV->new ({ strict => 1, sep_char => ";", }); + my $csv = Text::CSV->new ({ binary => 1, strict => 1, sep_char => ";", }); $values = $csv->csv (in => $fh, headers => [qw(SortOrder Name Description Category)], encoding => 'UTF-8', ); unless ( $values && ref($values) eq 'ARRAY' ) { push @results, loc("[_1]: Wrong file format", $filename); -- 2.11.0