X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7d9888e3edac66a713dceae3e0bab34e788c039c..c6a27f90a8e644ed00910aeddaff38c74b513032:/SL/Helper/Csv.pm diff --git a/SL/Helper/Csv.pm b/SL/Helper/Csv.pm index 3132b2846..5b629ee63 100644 --- a/SL/Helper/Csv.pm +++ b/SL/Helper/Csv.pm @@ -111,6 +111,14 @@ sub _check_header { ]) unless $header; } + # Special case: utf8 BOM. + # certain software (namely MS Office and notepad.exe insist on prefixing + # data with a discouraged but valid byte order mark + # if not removed, the first header field will not be recognized + if ($header && $header->[0] && $self->encoding =~ /utf-?8/i) { + $header->[0] =~ s/^\x{FEFF}//; + } + return unless $header; return $self->header([ map { lc } @$header ]); }