From 4b50f3fb5616e3858165e14d2d9d0b12dd8739ce Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Fri, 22 May 2015 22:00:01 +0200 Subject: LUtils::getCmdOutput enforce LANG=C different formats of output in different locales (eg. colon vs. point as decimal delimiters) --- libLumina/LuminaUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libLumina') diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index c9b13b8a..aa2336e3 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -43,6 +43,10 @@ int LUtils::runCmd(QString cmd, QStringList args){ QStringList LUtils::getCmdOutput(QString cmd, QStringList args){ QProcess proc; + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + env.insert("LANG", "C"); + env.insert("LC_MESSAGES", "C"); + proc.setProcessEnvironment(env); proc.setProcessChannelMode(QProcess::MergedChannels); if(args.isEmpty()){ proc.start(cmd); -- cgit