diff --git a/IPython/zmq/iostream.py b/IPython/zmq/iostream.py index 7fa896c..76c9d6e 100644 --- a/IPython/zmq/iostream.py +++ b/IPython/zmq/iostream.py @@ -4,7 +4,7 @@ from io import StringIO from session import extract_header, Message -from IPython.utils import io, text, encoding +from IPython.utils import io, text #----------------------------------------------------------------------------- # Globals @@ -22,6 +22,7 @@ class OutStream(object): topic=None def __init__(self, session, pub_socket, name): + self.encoding = 'UTF-8' self.session = session self.pub_socket = pub_socket self.name = name @@ -69,9 +70,8 @@ class OutStream(object): else: # Make sure that we're handling unicode if not isinstance(string, unicode): - enc = encoding.DEFAULT_ENCODING - string = string.decode(enc, 'replace') - + string = string.decode(self.encoding, 'replace') + self._buffer.write(string) current_time = time.time() if self._start <= 0: