summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2007-12-17 04:08:38 +0100
committerGuillaume Seguin <guillaume@segu.in>2007-12-17 04:08:38 +0100
commitec3a37740441e70d253e5f2b0bd0769978c28d74 (patch)
tree3c4e84b8a3cc01464694f653ed9da46b1288b9b3
parentac47c88f237f3145774b2c4dafc91cf822c0a404 (diff)
downloadcamlui-ec3a37740441e70d253e5f2b0bd0769978c28d74.tar.gz
camlui-ec3a37740441e70d253e5f2b0bd0769978c28d74.tar.bz2
* Encode & decode characters sent & received to/from camllight toplevelHEADmaster
-rw-r--r--camlui/process.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/camlui/process.py b/camlui/process.py
index 51770be..14f4e0a 100644
--- a/camlui/process.py
+++ b/camlui/process.py
@@ -27,6 +27,7 @@ import subprocess, signal, os
import threading
from re import split
from constants import *
+from decodeh import *
if win32:
import msvcrt, win32pipe, win32api, win32con, time
@@ -223,6 +224,7 @@ toplevels, using normal toplevel")
'''Read data from stdout'''
if data == None:
data = os.read (fd, 8192)
+ data = decode_heuristically (data)[0]
if self.stdout_cb:
self.stdout_cb (data)
self.from_stdout += data
@@ -233,6 +235,7 @@ toplevels, using normal toplevel")
'''Read data to stderr'''
if data == None:
data = os.read (fd, 8192)
+ data = decode_heuristically (data)[0]
if self.stderr_cb:
self.stderr_cb (data)
self.from_stderr += data
@@ -263,6 +266,7 @@ toplevels, using normal toplevel")
else: data += ";;\n"
if self.run_cb:
self.run_cb (" " + data)
+ data = data.encode ("iso-8859-15")
try:
os.write (self.process.stdin.fileno (), data)
except OSError: