Does CsvHelper not support quoted unescaped output or is there something wrong with my writer configuration?
Input:
Jake|"B" Street
CsvHelper reader configuration:
var readerConfig = new CsvConfiguration(CultureInfo.InvariantCulture)
{
Delimiter = "|",
TrimOptions = TrimOptions.Trim,
IgnoreBlankLines = true,
Mode = CsvMode.NoEscape
};
After record is read into memory, the value with double quotes is unescaped as expected: "B" Street
However, when I write records to CSV file if ShouldQuote = args => true is used without CsvMode.NoEscape double quotes are escaped and if I add CsvMode.NoEscape the output is not quoted at all.
writerConfiguration = new CsvConfiguration(CultureInfo.InvariantCulture)
{
ShouldQuote = args => true,
Mode = CsvMode.NoEscape
};
Output with CsvMode.NoEscape: "B" Street // Output not quoted and not escaped.
Output without CsvMode.NoEscape: """B"" Street" // Double quotes escaped.
Any ideas on how to write unescaped quoted values with CsvHelper?