Revision 07a38b9f
Von Sven Schöling vor mehr als 12 Jahren hinzugefügt
t/helper/csv.t | ||
---|---|---|
1 |
use Test::More tests => 40;
|
|
1 |
use Test::More tests => 41;
|
|
2 | 2 |
|
3 | 3 |
use lib 't'; |
4 | 4 |
|
... | ... | |
285 | 285 |
##### |
286 | 286 |
|
287 | 287 |
$csv = SL::Helper::Csv->new( |
288 |
file => \"Kaffee",
|
|
289 |
header => [ 'Description' ],
|
|
290 |
class => 'SL::DB::Part',
|
|
288 |
file => \"Kaffee", |
|
289 |
header => [ 'Description' ], |
|
290 |
class => 'SL::DB::Part', |
|
291 | 291 |
); |
292 | 292 |
$csv->parse; |
293 | 293 |
is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive header as param works'; |
294 | 294 |
|
295 |
##### |
|
296 |
|
|
297 |
$csv = SL::Helper::Csv->new( |
|
298 |
file => \"\x{FEFF}description\nKaffee", |
|
299 |
class => 'SL::DB::Part', |
|
300 |
encoding => 'utf8', |
|
301 |
); |
|
302 |
$csv->parse; |
|
303 |
is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'utf8 BOM works (bug 1872)'; |
|
304 |
|
|
295 | 305 |
# vim: ft=perl |
Auch abrufbar als: Unified diff
Bei Importdaten das UTF8 BOM ignorieren.
behebt Bug 1872