I am using the single header version of this csv parser as found in this repo.
When writing a csv, line breaks should be enclosed in quotes, according to rfc 4180 2.6
The function _csv_escape, however, does not quote those fields.
This leads to the situation that thsi csv reader can't read it's own csvs anymore, which is a bit unfortunate.
It works for me to just also test for \r and \n and then escape a string.
While looking at the code, however, I noticed this in _csv_escape
if (!quote_escape) {
if (quote_minimal) return std::string(in);
else {
std::string ret(Quote, 1);
ret += in.data();
ret += Quote;
}
}
I am using the single header version of this csv parser as found in this repo.
When writing a csv, line breaks should be enclosed in quotes, according to rfc 4180 2.6 The function _csv_escape, however, does not quote those fields. This leads to the situation that thsi csv reader can't read it's own csvs anymore, which is a bit unfortunate.
It works for me to just also test for \r and \n and then escape a string. While looking at the code, however, I noticed this in _csv_escape
which looks odd to me, as ret goes out of scope