Skip to content

Commit

Permalink
feat: decode program dicts as UTF-8 instead of local8bit (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenlebantongying authored Oct 13, 2024
1 parent ef57526 commit 40670d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dict/programs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 40670d8

Please sign in to comment.