WebAPIContrib.Core icon indicating copy to clipboard operation
WebAPIContrib.Core copied to clipboard

Quotes are not escaped (CSV formatters)

Open dmitriy-shleht opened this issue 7 years ago • 3 comments

Hi, For csv file needs double quotes to be escaped (by using another set of double quotes), because the double quote by itself denotes the boundaries of a field.

field 1,field 2,"field, with "escaped" quotes" - is not correct!

field 1,field 2,"field, with ""escaped"" quotes" - is сorrect

Here is a complete explanation including specific references to Excel handling: http://www.csvreader.com/csv_format.php

From Wikipedia: http://en.wikipedia.org/wiki/Comma-separated_values

Each of the embedded double-quote characters must be represented by a pair of double-quote characters. 1997, Ford, E350, "Super, ""luxurious"" truck"

dmitriy-shleht avatar Feb 23 '18 11:02 dmitriy-shleht

@dmitriy-shleht Thanks for reporting. Will look into this, fix it, or add an optional configuration for this

damienbod avatar Feb 26 '18 15:02 damienbod

Ok. In my spare time I will do it

dmitriy-shleht avatar Feb 26 '18 20:02 dmitriy-shleht

https://github.com/WebApiContrib/WebAPIContrib.Core/pull/138

damienbod avatar Jun 05 '18 09:06 damienbod