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
@tiagof thanks for using the library. As explain in the documentation
Formatting happens AFTER combining the header and the fields value if a header is available and CSV value BUT BEFORE you can access the actual value.
Which means that at that point the header record is already calculated hence no formatting can be applied on it.
What you can/should do to workaround this expected behaviour is to change how your formatter is being added to the CSV document.
<?php$csv = Reader::createFromPath('test.csv');
CharsetConverter::addTo($csv, 'ISO-8895-15'); //attach the CharsetConverter class as a stream filter$csv
->skipEmptyRecords()
->setHeaderOffset(0);
foreach ($csvas$row) {
dump(array_keys($row), array_values($row));
}
In this example, the CharsetConverter is used as a stream filter and stream filtering is applied before the CSV header is calculated which would result in ALL your CSV fields being converted.
Bug Report
Importing a file encoded in ISO-8895-15 where both the header and rows have accented characters
Summary
Importing a file with 1 header + 1 row (example), encoded in ISO-8895-15:
Standalone code, or other way to reproduce the problem
test.csv
Expected result
Actual result
Notice the "b" before "Café" showing that is not properly encoded.
The text was updated successfully, but these errors were encountered: