Fossil output is now treated as utf-8 on Windows
FossilOrigin-Name: 9c28f79677e9fcd17ba7927b07bdf1403d1d5715
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
#include <QDebug>
|
||||
#include <QProgressBar>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QTextCodec>
|
||||
#include "CommitDialog.h"
|
||||
#include "FileActionDialog.h"
|
||||
#include "CloneDialog.h"
|
||||
@ -1097,6 +1098,16 @@ bool MainWindow::runFossilRaw(const QStringList &args, QStringList *output, int
|
||||
fossilAbort = false;
|
||||
QString buffer;
|
||||
|
||||
#ifdef Q_WS_WIN32
|
||||
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
|
||||
#else
|
||||
QTextCodec *codec = QTextCodec::codecForLocale();
|
||||
#endif
|
||||
|
||||
Q_ASSERT(codec);
|
||||
QTextDecoder *decoder = codec->makeDecoder();
|
||||
Q_ASSERT(decoder);
|
||||
|
||||
while(true)
|
||||
{
|
||||
QProcess::ProcessState state = process.state();
|
||||
@ -1124,7 +1135,7 @@ bool MainWindow::runFossilRaw(const QStringList &args, QStringList *output, int
|
||||
qDebug() << input;
|
||||
#endif
|
||||
|
||||
buffer += input;
|
||||
buffer += decoder->toUnicode(input);
|
||||
|
||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||
|
||||
@ -1238,6 +1249,8 @@ bool MainWindow::runFossilRaw(const QStringList &args, QStringList *output, int
|
||||
}
|
||||
}
|
||||
|
||||
delete decoder;
|
||||
|
||||
// Must be finished by now
|
||||
Q_ASSERT(process.state()==QProcess::NotRunning);
|
||||
|
||||
|
Reference in New Issue
Block a user