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 <orgads@gmail.com>
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Peter Kümmel
2013-02-10 10:52:16 +01:00
parent 3f1fc6a450
commit e4e43352a8

View File

@@ -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