Closed
Description
When STRICT_CHECK_FOR_QUOTING is enabled and withoutComments() is used, Jackson should not escape strings starting with "#"
CsvMapper mapper = new CsvMapper();
mapper.configure(CsvGenerator.Feature.ALWAYS_QUOTE_STRINGS, false);
mapper.configure(CsvGenerator.Feature.STRICT_CHECK_FOR_QUOTING, true);
CsvSchema schema = mapper.schemaFor(recordClass).withoutComments();
mapper.writerFor(recordClass).with(schema).writeValue(wrtiter, record);
The record contains a single string field with value #abc.
Expected:
#abc is written to CSV file
Actual:
"#abc" is written to CSV file
In CsvEncoder::_needsQuotingStrict "(c == '#' && i == 0)" should be checked only when comments are enabled.