Fix input of UTF-8 wide chars: use encode() instead of str() for user input processing

This commit is contained in:
Gryllida A 2013-03-04 13:31:24 +01:00 committed by Sebastien Helleu
parent 7b4aefb28c
commit e09c80abf5
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ class InputLineEdit(QtGui.QLineEdit):
QtGui.QLineEdit.keyPressEvent(self, event) QtGui.QLineEdit.keyPressEvent(self, event)
def _input_return_pressed(self): def _input_return_pressed(self):
self._history.append(str(self.text())) self._history.append(self.text().encode('utf-8'))
self._history_index = len(self._history) self._history_index = len(self._history)
self.textSent.emit(self.text()) self.textSent.emit(self.text())
self.clear() self.clear()

View File

@ -130,7 +130,7 @@ class Network(QtCore.QObject):
self._socket.abort() self._socket.abort()
def send_to_weechat(self, message): def send_to_weechat(self, message):
self._socket.write(str(message)) self._socket.write(message.encode('utf-8'))
def desync_weechat(self): def desync_weechat(self):
self.send_to_weechat('desync\n') self.send_to_weechat('desync\n')