aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pycrctrl.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pycrctrl.py b/pycrctrl.py
index c54d147..4b87516 100644
--- a/pycrctrl.py
+++ b/pycrctrl.py
@@ -330,7 +330,7 @@ class PyCRCtrl(object):
return (CmdResult.SyntaxFail, "Bitte gib einen Szenarionamen an!")
if type(scenario) in [bytes, QByteArray]:
try:
- scenario = scenario.decode("utf-8")
+ scenario = self.codec.toUnicode(scenario)
except:
return (CmdResult.SyntaxFail, "Unbekannter Datentyp!")
@@ -391,7 +391,7 @@ class PyCRCtrl(object):
try:
output = self.clonk.stdout.readline()
- if bool(re.match(self.decodeRegExp(self.config.get("RegExps")["shutdownExp"]), output.decode("utf-8"))):
+ if bool(re.match(self.decodeRegExp(self.config.get("RegExps")["shutdownExp"]), self.codec.toUnicode(output))):
self.clonk.stdin.close()
elif output == b"" and self.clonk.poll() is not None:
if self.clonk:
@@ -401,8 +401,8 @@ class PyCRCtrl(object):
return
elif output:
- #output = self.codec.toUnicode(output).splitlines()[0]
- output = output.decode("utf-8").splitlines()[0]
+ output = self.codec.toUnicode(output).splitlines()[0]
+ #output = output.decode("utf-8").splitlines()[0]
output = output[(output.find("] ") if output.find("] ") != -1 else -2)+len("] "):]
if output[0] == ">":
@@ -471,7 +471,7 @@ class PyCRCtrl(object):
return (CmdResult.RuntimeError, "")
elif type(text) not in [bytes, QByteArray]:
try:
- text = text.encode("utf-8")
+ text = self.codec.toUnicode(text)
except:
raise IOError("Cannot write anything else to the server except the following data types: QString, bytes, str, QByteArray")