Bug 138678 - CSV export does not escape double quotes
Summary: CSV export does not escape double quotes
Status: RESOLVED FIXED
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-11 17:01 UTC by Marcel Cary
Modified: 2010-03-22 15:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Cary 2006-12-11 17:01:14 UTC
Version:           3.5 (using KDE KDE 3.5.1)
Installed from:    Unspecified Linux
OS:                Linux

CSV expects double quotes in a data field to be escaped, I think with a backslash, a lot like string literals in C:

  "don't \"quote\" me"

KaddressBook produces this insead:

  "don't "quote" me"

This causes OpenOffice.org Calc and Gnumeric to parse up to the record with the double quote just fine and then include the rest of the file in the last cell of the spreadsheet.

This may explain the behavior described here:

http://bugs.kde.org/show_bug.cgi?id=95998#c2

Work around: look for records with double quotes and remove them.

Note that most spreasheets support multi-line data in cells.  The newline is embedded literally, with the double quotes around that field distinguishing the newline from a record separator.  KaddressBook converts newlines in a field to backslash "n", which makes processing with shell scripts easier, but makes data in spreadsheets look odd.  In OpenOffice, the newlines are shown as backslash "n" rather than a newline.  I suppose this is a slightly different but related bug.
Comment 1 Leo Savernik 2007-01-12 23:32:20 UTC
Quotes in CSV are actually quoted by doubling them:

	A quote " ...

becomes

	"A quote "" ..."
Comment 2 Tobias Koenig 2009-08-05 16:31:55 UTC
The development of the old KAddressBook will be discontinued for KDE 4.4.
Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product.
Comment 3 Eckhart Wörner 2010-03-21 19:35:38 UTC
Confirmed to still exist in KDE SC 4.4
Comment 4 Eckhart Wörner 2010-03-21 19:35:51 UTC
*** This bug has been confirmed by popular vote. ***
Comment 5 Tobias Koenig 2010-03-22 14:56:52 UTC
SVN commit 1106339 by tokoe:

Quote '"' on CSV export correctly

BUG: 138678


 M  +8 -1      csv_xxport.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1106339
Comment 6 Eckhart Wörner 2010-03-22 15:52:50 UTC
Will the fix get backported to 4.4 branch?