WebApiContrib / WebAPIContrib.Core

Community Contributions for ASP.NET Core
MIT License
461 stars 116 forks source link

Enclosed quotes expansion #205

Closed mguinness closed 3 years ago

mguinness commented 4 years ago

Text with quotes is escaped but not enclosed with quotes per RFC4180:

If fields are not enclosed with double quotes, then double quotes may not appear inside the fields.

For example Reviewed "bad" code is output as Reviewed ""bad"" code instead of "Reviewed ""bad"" code".

Another possible change not included in this PR is preserving new line characters by enclosing with double quotes:

Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes.

That would be a breaking change, but another formatter option could be added for backwards compatibility.

mguinness commented 3 years ago

Thought I'd follow up, will anyone be able to review?

damienbod commented 3 years ago

@mguinness I'll review this at the weekend, next week. Sorry about missing this. Could you fix the fix merge conflict in the meantime

Greetings Damien

damienbod commented 3 years ago

@mguinness works great, thanks

damienbod commented 3 years ago

released : https://www.nuget.org/packages/WebApiContrib.Core.Formatter.Csv/4.0.0