ProjectExplorer: Fix switching build console to Utf8 for MSVC

Wrap make command into the script to switch console code page
to Utf8 before make (when the Kit check is on).

Task-number: QTCREATORBUG-20327
Change-Id: Ie3e372e52a09b93a41c5ac7ad63b7b14384655fb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-04-27 12:34:13 +02:00
parent 8ea31bb1e1
commit 75afda1798
3 changed files with 39 additions and 10 deletions

View File

@@ -25,6 +25,7 @@
#include "abstractprocessstep.h"
#include "ansifilterparser.h"
#include "buildconfiguration.h"
#include "buildstep.h"
#include "project.h"
#include "task.h"
@@ -305,8 +306,11 @@ void AbstractProcessStep::processReadyReadStdOutput()
if (!m_process)
return;
m_process->setReadChannel(QProcess::StandardOutput);
const bool utf8Output = buildConfiguration()->environment().hasKey("VSLANG");
while (m_process->canReadLine()) {
QString line = QString::fromLocal8Bit(m_process->readLine());
QString line = utf8Output ? QString::fromUtf8(m_process->readLine())
: QString::fromLocal8Bit(m_process->readLine());
stdOutput(line);
}
}