mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Properly escape " in strings when exporting CSV
This commit is contained in:
parent
b34c5f3c0f
commit
875f71d4ef
@ -27,8 +27,9 @@ void CSVModelWriter::addColumn(const QString &title, int column, int role)
|
||||
|
||||
static void writeValue(QTextStream &f, const QString &value)
|
||||
{
|
||||
// TODO: quoting if " or \n in string
|
||||
f << "\"" << value << "\"";
|
||||
QString escaped = value;
|
||||
escaped.replace('"', "\"\"");
|
||||
f << "\"" << escaped << "\"";
|
||||
}
|
||||
|
||||
static void writeSep(QTextStream &f)
|
||||
|
Loading…
Reference in New Issue
Block a user