##// END OF EJS Templates
Use 'UTF-8' as the `encoding` attribute in `OutStream` class....
Bradley M. Froehle -
Show More
@@ -4,7 +4,7 b' from io import StringIO'
4
4
5 from session import extract_header, Message
5 from session import extract_header, Message
6
6
7 from IPython.utils import io, text, encoding
7 from IPython.utils import io, text
8 from IPython.utils import py3compat
8 from IPython.utils import py3compat
9
9
10 #-----------------------------------------------------------------------------
10 #-----------------------------------------------------------------------------
@@ -23,6 +23,7 b' class OutStream(object):'
23 topic=None
23 topic=None
24
24
25 def __init__(self, session, pub_socket, name):
25 def __init__(self, session, pub_socket, name):
26 self.encoding = 'UTF-8'
26 self.session = session
27 self.session = session
27 self.pub_socket = pub_socket
28 self.pub_socket = pub_socket
28 self.name = name
29 self.name = name
@@ -73,9 +74,8 b' class OutStream(object):'
73 else:
74 else:
74 # Make sure that we're handling unicode
75 # Make sure that we're handling unicode
75 if not isinstance(string, unicode):
76 if not isinstance(string, unicode):
76 enc = encoding.DEFAULT_ENCODING
77 string = string.decode(self.encoding, 'replace')
77 string = string.decode(enc, 'replace')
78
78
79 self._buffer.write(string)
79 self._buffer.write(string)
80 current_time = time.time()
80 current_time = time.time()
81 if self._start <= 0:
81 if self._start <= 0:
General Comments 0
You need to be logged in to leave comments. Login now