Skip to content

Commit

Permalink
ParserCSV: guard use of QTextStream::setCodec
Browse files Browse the repository at this point in the history
QTextStream::setCodec was removed in Qt6.
https://bugreports.qt.io/browse/QTBUG-75665
  • Loading branch information
Be-ing committed Oct 13, 2021
1 parent 3c31bd2 commit 2ac3952
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/library/parsercsv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ bool ParserCsv::writeCSVFile(const QString &file_str, BaseSqlTableModel* pPlayli

qDebug() << "Basepath: " << base;
QTextStream out(&file);
out.setCodec("UTF-8"); // rfc4180: Common usage of CSV is US-ASCII ...
// Using UTF-8 to get around codepage issues
// and it's the default encoding in Ooo Calc
// rfc4180: Common usage of CSV is US-ASCII ...
// Using UTF-8 to get around codepage issues
// and it's the default encoding in Ooo Calc
// UTF-8 is the default in Qt6.
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
out.setCodec("UTF-8");
#endif

// writing header section
bool first = true;
Expand Down

0 comments on commit 2ac3952

Please sign in to comment.