Support äöü
authorChristian Weiske <weiske@mogic.com>
Fri, 6 May 2016 07:41:48 +0000 (09:41 +0200)
committerChristian Weiske <weiske@mogic.com>
Fri, 6 May 2016 07:41:48 +0000 (09:41 +0200)
exec.py

diff --git a/exec.py b/exec.py
index 8efb4445e579d13f5eb841caf6f540b81a4b3cd1..c7277ba7b340b964b891ab5135ca613223640cfc 100644 (file)
--- a/exec.py
+++ b/exec.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 import os
 import re
 import subprocess
@@ -56,19 +57,17 @@ class Exec(BotPlugin):
         """
         Execute the commmand
         """
-        for part in ("abc"):
-            print "part: ", part
         try:
             output = subprocess.check_output(
-                [self.config['command'], str(msg), str(msg.frm)],
+                [self.config['command'], unicode(msg.body), unicode(msg.frm)],
                 stderr=subprocess.STDOUT
             )
             if len(output) > 0:
-                return output
+                return unicode(output, 'utf-8')
             else:
                 return "OK\n"
         except subprocess.CalledProcessError as err:
             if len(err.output):
-                return err.output
+                return unicode(err.output, 'utf-8')
             else:
-                return "Error" 
+                return "Error"