I've got a Qt program that reads from csv files and saves the info into a database. There was no problem until i tried to update from Qt 5.15.2 to Qt 6.3. Now, when I read from the files, all accents are converted to a question mark.
I've tried using pretty much every way to explicitly interpret a QTextStream or convert a QString text to Utf-8 or Unicode in general and they all failed to work. Is this a known issue in Qt 6 (because accents worked perfectly in Qt 5.15.2)?
Thanks in advance.
As requested here's the fragment that reads the csv files:
QFile file(path);
file.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream in(&file);
while (in.readLineInto(&line)){
QStringList separatedLine = line.split("\t");
qDebug() << separatedLine;
//do things and save data in database
}
The issue I have is that this works perfectly if I compile it with Qt5.15.2 but not in Qt6.3.0. Reading the exact same .csv file the following is debbuged:
//Original line
34111514 TARJETA COMUNICACIÓN TMB-251 TMB251
//Qt 5.15.2 qDebug outputs
QList("34111514", "TARJETA COMUNICACIÓN TMB-251", "TMB251")
//Qt 6.3 qDebug outputs
QList("34111514", "TARJETA COMUNICACI?N TMB-251", "TMB251")
I highly doubt it's a problem with the csv file formatting because it works fine in older Qt.