forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user