Commit e4e43352 authored by Peter Kümmel's avatar Peter Kümmel
Browse files

Git's config is UTF-8 encoded on Windows

'git config' command returns UTF-8 strings if the encoding of the file was not hijacked by the user.

Task-number: QTCREATORBUG-8696

Change-Id: I6181a26e56e2883ad5d46194f974e799bfd2aafb
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <>
Reviewed-by: default avatarPeter Kümmel <>
Reviewed-by: default avatarTobias Hunger <>
parent 3f1fc6a4
......@@ -2399,9 +2399,11 @@ QString GitClient::readConfig(const QString &workingDirectory, const QStringList
QByteArray outputText;
QByteArray errorText;
if (fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText, false))
return commandOutputFromLocal8Bit(outputText);
return QString();
if (!fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText, false))
return QString();
if (Utils::HostOsInfo::isWindowsHost())
return QString::fromUtf8(outputText).remove(QLatin1Char('\r'));
return commandOutputFromLocal8Bit(outputText);
// Read a single-line config value, return trimmed
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