-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double headers when both detect_bom and headers are provided #63
Comments
Relatively easy to reproduce (in CSV_XS). This will most likely be the new test-unit:
Still failing, but working on it … |
fix for Text::CSV_XS being tested. The next commit makes it PASS all the way back to perl-5.6.1. |
Thanks. Shipped Text::CSV 2.03 with the fixes from Text::CSV_XS 1.51 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
Using the module for a command-line tool, I'm consistently setting
headers => 'auto'
and give the possibility to specify adetect_bom
based on a command-line option.Tests show that when both options are active, headers are read twice, which ends up skipping the first line (where real headers live) and trying to set headers from the second line.
I'd say that this behaviour is surprising and sub-optimal, although admittedly there's no indication that this should not behave this way in the docs. I'm currently working this around like this:
If you're interested, this is a full test for this:
Output:
The text was updated successfully, but these errors were encountered: