You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When CSV file is an US standard, has only letters (Dec) code from c.a. 33 to 127 imports works fine.
Other Localisation, non english languages, letters like "óęłńśżźŻŹĆÓŁĘŚŃ" return all fields in one line empty (null), even if only ''strange'' letter exist. After removing that letter, work.
Code is simple:
if (move_uploaded_file($this->data['Payment']['file']['tmp_name'], $filename)) {
$csv = Reader::createFromPath($filename);
$headers = $csv->fetchOne(); -----> works on first line
echo debug($headers);
$data = $csv->setOffset(0)->setLimit(2)->fetchAll(); ----> not working
echo debug($data);
}
Source file is:
--------------------cut here-------------
2014-09-09;2014-09-09;PRZELEW ZEWNETRZNY PRZYCHODZACY;"OPLATA ZA KURS, MICHAL ";"ANDRZEJ JERZY UL. 11 LISTOPADA 08-110 SIEDLCE";'6575676646444666444545454545';200,00;250,67;
2014-09-09;2014-09-09;PRZELEW ZEWN TRZNY PRZYCHODZ•CY;"OP£ATA ZA KURS, JAKUB ";"ANDRZEJ JERZY UL. 11 LISTOPADA 08-110 SIEDLCE";'4435446435354657656575634534534534535';200,00;450,67;
-----------cut-here-------------
The text was updated successfully, but these errors were encountered:
Assuming your are getting a CSV in a different locale as yours, you should first try to use the stream filtering capabilities as explained in the documentation and in the example.
You should also look at the FilterTranscode class as a example on how to transcode on the fly your CSV.
Hope it will help
Assuming your are getting a CSV in a different locale as yours, you should first try to use the stream filtering capabilities as explained in the documentation and in the example.
Hope it will help
—
Reply to this email directly or view it on GitHub.
When CSV file is an US standard, has only letters (Dec) code from c.a. 33 to 127 imports works fine.
Other Localisation, non english languages, letters like "óęłńśżźŻŹĆÓŁĘŚŃ" return all fields in one line empty (null), even if only ''strange'' letter exist. After removing that letter, work.
Code is simple:
if (move_uploaded_file($this->data['Payment']['file']['tmp_name'], $filename)) {
$csv = Reader::createFromPath($filename);
$headers = $csv->fetchOne(); -----> works on first line
echo debug($headers);
$data = $csv->setOffset(0)->setLimit(2)->fetchAll(); ----> not working
echo debug($data);
}
Source file is:
--------------------cut here-------------
2014-09-09;2014-09-09;PRZELEW ZEWNETRZNY PRZYCHODZACY;"OPLATA ZA KURS, MICHAL ";"ANDRZEJ JERZY UL. 11 LISTOPADA 08-110 SIEDLCE";'6575676646444666444545454545';200,00;250,67;
2014-09-09;2014-09-09;PRZELEW ZEWN TRZNY PRZYCHODZ•CY;"OP£ATA ZA KURS, JAKUB ";"ANDRZEJ JERZY UL. 11 LISTOPADA 08-110 SIEDLCE";'4435446435354657656575634534534534535';200,00;450,67;
-----------cut-here-------------
The text was updated successfully, but these errors were encountered: