Skip to content

Commit

Permalink
Change the newline character for CSV export depending upon the platform
Browse files Browse the repository at this point in the history
  • Loading branch information
justinclift committed May 17, 2016
1 parent c943522 commit f05e3a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ExportCsvDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f05e3a2

Please sign in to comment.