Skip to content

Commit 58481af

Browse files
mailchuckPeterSurda
authored andcommitted
Completer unicode fixes
1 parent 46edb72 commit 58481af

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/bitmessageqt/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,13 +1895,13 @@ def addRow (address, label, type):
18951895
completerList = []
18961896
for address in sorted(oldRows, key = lambda x: oldRows[x][2], reverse = True):
18971897
if address in newRows:
1898-
completerList.append(newRows[address][0] + " <" + address + ">")
1898+
completerList.append(unicode(newRows[address][0], encoding="UTF-8") + " <" + address + ">")
18991899
newRows.pop(address)
19001900
else:
19011901
self.ui.tableWidgetAddressBook.removeRow(oldRows[address][2])
19021902
for address in newRows:
19031903
addRow(address, newRows[address][0], newRows[address][1])
1904-
completerList.append(newRows[address][0] + " <" + address + ">")
1904+
completerList.append(unicode(newRows[address][0], encoding="UTF-8") + " <" + address + ">")
19051905

19061906
# sort
19071907
self.ui.tableWidgetAddressBook.sortByColumn(0, Qt.AscendingOrder)
@@ -3187,8 +3187,8 @@ def on_action_AddressBookSend(self):
31873187
if self.ui.lineEditTo.text() == '':
31883188
self.ui.lineEditTo.setText(stringToAdd)
31893189
else:
3190-
self.ui.lineEditTo.setText(str(
3191-
self.ui.lineEditTo.text()) + '; ' + stringToAdd)
3190+
self.ui.lineEditTo.setText(unicode(
3191+
self.ui.lineEditTo.text().toUtf8(), encoding="UTF-8") + '; ' + stringToAdd)
31923192
if listOfSelectedRows == {}:
31933193
self.statusBar().showMessage(_translate(
31943194
"MainWindow", "No addresses selected."))

src/bitmessageqt/foldertree.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,16 +491,16 @@ def onCursorPositionChanged(self, oldPos, newPos):
491491

492492
def splitPath(self, path):
493493
stringList = []
494-
text = unicode(path.toUtf8())
494+
text = unicode(path.toUtf8(), encoding="UTF-8")
495495
splitIndex = rfind(text[0:self.widget().cursorPosition()], ";") + 1
496496
str = text[splitIndex:self.widget().cursorPosition()]
497497
str = rstrip(lstrip(str))
498498
stringList.append(str)
499499
return stringList
500500

501501
def pathFromIndex(self, index):
502-
autoString = unicode(index.data(QtCore.Qt.EditRole).toString())
503-
text = unicode(self.widget().text().toUtf8())
502+
autoString = unicode(index.data(QtCore.Qt.EditRole).toString().toUtf8(), encoding="UTF-8")
503+
text = unicode(self.widget().text().toUtf8(), encoding="UTF-8")
504504

505505
# If cursor position was saved, restore it, else save it
506506
if self.cursorPos != -1:

0 commit comments

Comments
 (0)