Closed teiles closed 9 years ago
Added around 2.6.1, we were on 2.5
Everything is working as expected then?
Josh ---
Not working because I was using WriteField(field, shouldQuote)
See PR.
Thanks --- Ted
On Fri, Apr 3, 2015 at 10:27 AM, Josh Close notifications@github.com wrote:
Everything is working as expected then?
— Reply to this email directly or view it on GitHub https://github.com/JoshClose/CsvHelper/issues/369#issuecomment-89303390.
OK. I'll open it back up then. :)
Hi,
Great job with the CsvHelper. Just wanted to mention i did encounter this same issue for text with left double quotes and right double quotes (curly quotes).
cheers
Can you give an example on how to reproduce? Thanks.
Hi Josh,
Thank you for the answer. I have some text "19” alloy wheels .... " ( after 19 a curly quote) And I write it like this ... csv.WriteField(vehicle.Features, true); ...
Don't know if makes a difference but need to use latin 1 (i'm annoyed too :) ) Data comes from database
using (StreamWriter writer = new StreamWriter(File.Open(filelocation, FileMode.Create), Encoding.GetEncoding("ISO-8859-1"))) .... csv.Configuration.Encoding = Encoding.GetEncoding("iso-8859-1");
Oh, I see. Those aren't the same as the quote character. I think you could make it always quote to solve that. Configuration.QuoteAllFields = true;
Given following three fields: A, B, and C Hi, you are "Great"! 00000000-0000-0000-0000-000000000000
Expected CSV row: "A, B, and C","Hi, you are ""Great""",00000000-0000-0000-0000-000000000000
Actual CSV row: "A, B, and C","You are "Great"",00000000-0000-0000-0000-000000000000
CsvHelper does not escape the double-quote with doubled double-quotes.
The current code is:
Reference
Should this feature be part of CsvHelper? If so, I'll write it.