Skip to content

Commit

Permalink
Merge pull request #7510 from ehuelsmann/fix/master/utf8-import
Browse files Browse the repository at this point in the history
Fix imports stopping on the first row with a non-ascii character
  • Loading branch information
ehuelsmann committed Jul 16, 2023
2 parents 226cddd + aa611f5 commit 998cff0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/LedgerSMB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,17 @@ sub upload {
$encoding = 'UTF-32BE';
$bom_length = 4;
}
else { # no BOM
$encoding = 'UTF-8';
$bom_length = 0;
}
sysseek $fh, 0, 0;
}

if ($bom_length) {
if ($encoding) {
binmode $fh, ':encoding(' . $encoding . ')';
}
if ($bom_length) {
read($fh, my $unused, 1); # read the bom character
}

Expand Down

0 comments on commit 998cff0

Please sign in to comment.