feat: decode program dicts as UTF-8 instead of local8bit (#1821)
Some checks failed
SonarCloud / Build and analyze (push) Has been cancelled

This commit is contained in:
shenleban tongying 2024-10-12 22:05:38 -04:00 committed by GitHub
parent ef57526762
commit 40670d8197
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -200,7 +200,7 @@ void RunInstance::handleProcessFinished()
QByteArray err = process.readAllStandardError();
if ( !err.isEmpty() ) {
error += "\n\n" + QString::fromLocal8Bit( err );
error += "\n\n" + QString::fromUtf8( err );
}
}
@ -252,8 +252,8 @@ void ProgramDataRequest::instanceFinished( QByteArray output, QString error )
prog_output = QString::fromUtf8( output.data() + 3, output.length() - 3 );
}
else {
// No BOM, assume local 8-bit encoding
prog_output = QString::fromLocal8Bit( output );
// No BOM, assume UTF-8 encoding
prog_output = QString::fromUtf8( output );
}
}
catch ( std::exception & e ) {