-
Notifications
You must be signed in to change notification settings - Fork 76
Two doubles quotes in columns causes Unexpected character exception #151
Comments
@youribonnaffe Thank you for reporting this problem. From code and example it seems to me this should just work as is. Just one question: which version of Jackson are you using? Latest stable versions are 2.9.0 / 2.8.9. |
I'm using 2.8.9 |
Thank you for confirming. That sounds odd as I am pretty sure this functionality has been around and tested for a long time. |
Hmmh. Actually, I am not sure this is a bug after all. The problem is that the first double-quote is taken to mean that the column value is quoted. Having said that, CSV "specification" is quite loose, as there isn't really an official specification. |
Ok, reading RFC 4180, I see:
which I think spells out why the test case is invalid -- field must be quoted (as it contains double-quotes itself) and each double-quote within must be doubled itself. |
I agree, the value is probably malformatted according to the RFC. Still do you think there is an interest to support such usage if that could be done without breaking the existing implementation? |
@youribonnaffe if that could be supported (perhaps via optional |
I have a CSV file with the following content (just a limited extract here):
Parsing this CSV content with CsvMapper causes the following error:
Here is a unit test to reproduce the issue:
Is there a way to configure the parser to be more flexible about this usage of quotes?
Unfortunately the CSV file is not under my control and I won't be able to change it's format.
Parsing this file with OpenCSV was working but I was hoping to switch to Jackson for better performances.
The text was updated successfully, but these errors were encountered: