Fix handling of utf-8 chars
authorEmmanuel Lacour <elacour@easter-eggs.com>
Fri, 11 Feb 2022 16:57:57 +0000 (17:57 +0100)
committerEmmanuel Lacour <elacour@easter-eggs.com>
Fri, 11 Feb 2022 16:57:57 +0000 (17:57 +0100)
html/Admin/CustomFields/ImportValues.html

index 6a197e2..b6426fb 100644 (file)
@@ -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);