Change the newline character for CSV export depending upon the platform

This commit is contained in:
Justin Clift
2016-05-17 17:59:23 +01:00
parent c943522d28
commit f05e3a211c

View File

@@ -67,7 +67,13 @@ bool ExportCsvDialog::exportQuery(const QString& sQuery, const QString& sFilenam
QChar quoteChar = currentQuoteChar();
QString quotequoteChar = QString(quoteChar) + quoteChar;
QChar sepChar = currentSeparatorChar();
// Choose appropriate newline character for the platform
#ifdef Q_OS_WIN
QString newlineChar = "\r\n";
#else
QString newlineChar = "\n";
#endif
// chars that require escaping
std::string special_chars = newlineChar.toStdString() + sepChar.toLatin1() + quoteChar.toLatin1();