Commit 0859095b authored by Tobias Hunger's avatar Tobias Hunger Committed by Tim Jenssen

MSVC: Do not ask to return utf-8 from Windows Vista and earlier

Do not ask the script getting the MSVC environment to return utf-8 output
prior to windows 7. Attempting that breaks the script and makes it return
empty output.

Task-number: QTCREATORBUG-17501
Change-Id: Ic5a87f87cea9e77687744c712c4f24aa9b20a6e5
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 24b2347a
......@@ -30,10 +30,12 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorersettings.h>
#include <utils/hostosinfo.h>
#include <utils/qtcprocess.h>
#include <utils/synchronousprocess.h>
#include <QDir>
#include <QSysInfo>
#include <QTemporaryFile>
#include <QTextCodec>
......@@ -271,7 +273,8 @@ bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env,
call += ' ';
call += batchArgs.toLocal8Bit();
}
saver.write("chcp 65001\r\n");
if (Utils::HostOsInfo::isWindowsHost() && QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7)
saver.write("chcp 65001\r\n"); // Only works for Windows 7 or later
saver.write(call + "\r\n");
saver.write("@echo " + marker.toLocal8Bit() + "\r\n");
saver.write("set\r\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment