Skip to content

Commit

Permalink
Merge pull request sqlitebrowser#592 from justinclift/fixcvsexportnew…
Browse files Browse the repository at this point in the history
…lines

Change the newline character for CSV export depending upon the platform
  • Loading branch information
justinclift committed May 17, 2016
2 parents c943522 + f05e3a2 commit 769fc30
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 769fc30

Please sign in to comment.