#38 AbstractCsvWriter.escapeString() does not increment the line count correctly for embedded newlines

2.1.0
closed
James Bassett
None
7
2013-04-24
2013-01-17
James Bassett
No

AbstractCsvWriter.escapeString() does not increment the line count correctly for embedded newlines. Currently, it only increments the line count for \n. This needs to be updated to cater for \r and \r\n as well (just like LineNumberReader).

It also replaces line terminators with the end of line symbols in the preferences (someone might disagree, but I think that's not a bad idea), so it should do the same for the other line terminators as well.

Discussion

  • James Bassett
    James Bassett
    2013-01-17

    • status: open --> pending
     
  • James Bassett
    James Bassett
    2013-01-17

    Fixed in [r274].

    Now I'm having second thoughts about how it replaces embedded line terminators (any of the 3) with the preference 'end of line symbols'. That is actually modifying the data (what if you wanted your data to be independent of the line terminators used for the CSV file??).

    It might be a candidate for a preference, though I'm not sure what the default should be (replace or preserve?)!

     

    Related

    Commit: [r274]

  • James Bassett
    James Bassett
    2013-04-24

    • Status: pending --> closed