Skip to content
Permalink
Browse files

Merge pull request #2700 from alexbruy/actions-encoding

convert stdout and stderr from actions to correct encoding (fix #13896)
  • Loading branch information
alexbruy committed Feb 5, 2016
2 parents 57b5eb9 + 7fc88c2 commit cb7d0fb4581d06b2db4745d6b8ad060eeb2ca5ab
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/core/qgsrunprocess.cpp
@@ -23,6 +23,7 @@
#include "qgslogger.h"
#include "qgsmessageoutput.h"
#include <QProcess>
#include <QTextCodec>
#include <QMessageBox>

QgsRunProcess::QgsRunProcess( const QString& action, bool capture )
@@ -90,15 +91,19 @@ void QgsRunProcess::die()

void QgsRunProcess::stdoutAvailable()
{
QString line( mProcess->readAllStandardOutput() );
QByteArray bytes( mProcess->readAllStandardOutput() );
QTextCodec *codec = QTextCodec::codecForLocale();
QString line( codec->toUnicode( bytes ) );

// Add the new output to the dialog box
mOutput->appendMessage( line );
}

void QgsRunProcess::stderrAvailable()
{
QString line( mProcess->readAllStandardError() );
QByteArray bytes( mProcess->readAllStandardOutput() );
QTextCodec *codec = QTextCodec::codecForLocale();
QString line( codec->toUnicode( bytes ) );

// Add the new output to the dialog box, but color it red
mOutput->appendMessage( "<font color=red>" + line + "</font>" );

0 comments on commit cb7d0fb

Please sign in to comment.
You can’t perform that action at this time.