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 quotes inside a field aren't handled correctly #18
Comments
Thanks for the report. I'm using a library to parse CSV but not to write to CSV and probably that's causing this (very strange) behaviour. Specifically, I think the issue is the EDIT: I can confirm the issue scala> val s = "Jon,Snow \"III\" of Winterfell"
s: String = Jon,Snow "III" of Winterfell
scala> CSVReader[Person].readCSVFromString(s).toCSV()
res4: String = "Jon","Snow "III" of Winterfell"
|
Thank you for writing the library! I've used it for a few projects here at The Guardian and it worked great so far ;) |
Nice to know that the library is doing its job :). I made 19 which should fix this via quoting fields in a way that the underlying parser can parse quote fields. @oilnam do you have sometime to quick check the PR? I made a test which should be representative, can you tell me if this covers the issue? I will publish a new version with the patch as soon as I'm sure it works. |
PureCSV correctly parses a string like:
Jon,"Snow of Winterfell"
but it fails when the quotes are not wrapping the entire field, e.g.
Jon,Snow "III" of Winterfell
Steps to reproduce:
The text was updated successfully, but these errors were encountered: