CSV should escape using double-quotes

Bug #816348 reported by Nick White
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE OpenObject Client
New
Undecided
Unassigned

Bug Description

When exporting data and you can get CSV output by choosing "Save as CSV". However, if one of the fields exported has double quotes, they are escaped with a backslash, so

Product 10" becomes Product 10\"

However, CSVs should escape double-quotes using a quote, so the above example would read Product 10""

Otherwise, openoffice (at least) screws up with CSVs with quotes.

Revision history for this message
Nick White (r-launchpad-njw-me-uk) wrote :

This is documented here, by the way: http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm#FileFormat

> Fields that contain double quote characters must be surounded by double-quotes, and
> the embedded double-quotes must each be represented by a pair of consecutive
> double quotes.
> So, John "Da Man" Doe would convert to "John ""Da Man""",Doe, 120 any st.,...

Wikipedia acknowledges using \ to escape, but says that only "some implementations" do it, rather than "many implementations" which use double-quoting.

Revision history for this message
Nick White (r-launchpad-njw-me-uk) wrote :

Attached is a patch fixing the CSV quoting.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.