diff hgrunner.cpp @ 45:4286836bb3c9

* Some more work on graph layout; ensure LANG is set for parseable UTF8 output when running Hg
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 10 Nov 2010 12:44:11 +0000
parents bed7ab59f62e
children c76782c14371
line wrap: on
line diff
--- a/hgrunner.cpp	Tue Nov 09 17:51:12 2010 +0000
+++ b/hgrunner.cpp	Wed Nov 10 12:44:11 2010 +0000
@@ -13,6 +13,11 @@
 {
     proc = new QProcess(this);
 
+    QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+    env.insert("LANG", "en_US.utf8");
+    env.insert("LC_ALL", "en_US.utf8");
+    proc->setProcessEnvironment(env);
+
     setTextVisible(false);
     setVisible(false);
     isRunning = false;
@@ -39,8 +44,8 @@
 {
     exitCode = procExitCode;
     exitStatus = procExitStatus;
-    stdOut = proc -> readAllStandardOutput();
-    stdErr = proc -> readAllStandardError();
+    stdOut = QString::fromUtf8(proc -> readAllStandardOutput());
+    stdErr = QString::fromUtf8(proc -> readAllStandardError());
     std::cerr << "stdout was " << stdOut.toStdString() << std::endl;
 }