Commit 79e8f885 authored by Yuchen Deng's avatar Yuchen Deng Committed by Tobias Hunger
Browse files

Git: Fix log encoding

We should using "i18n.logOutputEncoding" as we can.
In default, it should be 'utf-8'.

Change-Id: Ic5af2869e5fd5273a712f28e8e59149a4c2ef2b7
Reviewed-by: default avatarTobias Hunger <>
parent b612e9b1
......@@ -843,7 +843,14 @@ bool GitClient::synchronousLog(const QString &workingDirectory, const QStringLis
const bool rc = fullySynchronousGit(workingDirectory, allArguments, &outputText, &errorText);
if (rc) {
*output = commandOutputFromLocal8Bit(outputText);
QString encodingName = readConfigValue(workingDirectory, QLatin1String("i18n.logOutputEncoding"));
if (encodingName.isEmpty())
encodingName = QLatin1String("utf-8");
QTextCodec *codec = QTextCodec::codecForName(encodingName.toLocal8Bit());
if (codec)
*output = codec->toUnicode(outputText);
*output = commandOutputFromLocal8Bit(outputText);
} else {
const QString errorMessage = tr("Cannot obtain log of \"%1\": %2").
Supports Markdown
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