From d94397443963a3dcad267cbb25dd2128c352bc6b Mon Sep 17 00:00:00 2001 From: delicatebits Date: Mon, 1 Apr 2013 20:52:22 -0400 Subject: [PATCH] Updated to catch exception --- bitmessagemain.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index 60dd894f..f4cf3d57 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -4641,7 +4641,13 @@ class MyForm(QtGui.QMainWindow): raise SystemExit def on_action_InboxMsgForceHtml(self): - lines = str(self.ui.textEditInboxMessage.toPlainText()).split('\n') + # Updated to work with all characters. Previously, non-english characters caused errors. + try: + lines = str(self.ui.textEditInboxMessage.toPlainText()).split('\n') + except UnicodeEncodeError: + currentInboxRow = self.ui.tableWidgetInbox.currentRow() + self.ui.textEditInboxMessage.setHtml(self.ui.tableWidgetInbox.item(currentInboxRow,2).data(Qt.UserRole).toPyObject()) + return from_prefix = 'Message ostensibly from ' for i in xrange(len(lines)): if lines[i].find(from_prefix) != -1: @@ -4649,6 +4655,7 @@ class MyForm(QtGui.QMainWindow): elif lines[i] == '------------------------------------------------------': lines[i] = '
' content = '\n'.join(lines) + content = content.replace('\n\n', '

') self.ui.textEditInboxMessage.setHtml(QtCore.QString(content)) def on_action_InboxReply(self):