-
Notifications
You must be signed in to change notification settings - Fork 194
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
Adds a test to show error described in #126 (also fixes #126) #128
Conversation
…irectly from a string
Now also fixes #126 |
@DivineDominion Hi, any chance of a quick review? Thanks. |
Ah, I see -- the now 'designated' string-based initializer does all the heavy lifting instead of the many URL based ones. That sounds sensible to me; I'll approve and merge into master. Thank you! In the meantime: @lardieri Do you recall any good reason we did not go ahead with this, or did we just not notice when you came up with the first BOM fix? |
It's not that we didn't notice. It's that we decided it was irrelevant. BOMs do not apply to A The BOM is a hint to the decoder that turns a sequence of bytes into a If someone is passing you a Unfortunately, as I mentioned in this comment, Apple's UTF-8 decoder is buggy. Given all of the above, we decided we would deal with BOMs at the point where we decode a sequence of bytes into a It's not that I strongly object to moving the BOM handler into the designated initializer. I just feel that it is papering over a bug elsewhere, namely in the code that reads the byte contents of the Excel CSV file and turns it into a |
Thank you for the reminder and summary!
It's true that this is none of SwiftCVS's responsibility and we could do without this completely. But 'Postel's Law' for robust software ("Be conservative in what you do, be liberal in what you accept from others") isn't a bad idea. Apple bugs usually don't go away quickly, so we can make the journey simpler for users of the library. That should be good for developer happiness. If nobody is objecting: @Diggory would you be willing to add a comment to the BOM that summarizes why we're doing that (b/c Apple's code is buggy) and point to |
Will do. |
Adds a test to check if creating a CSV instance directly from a string that starts with a BOM correctly creates the headers (without the BOM in the first header.). This is referencing issue #126