tfix utf8 encode/decode in labels plugin - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 117c5631824fa588dec5d01798939582eec1bc66 DIR parent 302e4447178b396d2a4405d646947a1073d973a7 HTML Author: ThomasV <thomasv@gitorious> Date: Wed, 10 Sep 2014 15:28:41 +0200 fix utf8 encode/decode in labels plugin Diffstat: M plugins/labels.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- DIR diff --git a/plugins/labels.py b/plugins/labels.py t@@ -39,15 +39,14 @@ class Plugin(BasePlugin): return "0.2.1" def encode(self, message): - encrypted = electrum.bitcoin.aes_encrypt_with_iv(self.encode_password, self.iv, unicode(message)) + encrypted = electrum.bitcoin.aes_encrypt_with_iv(self.encode_password, self.iv, message.encode('utf8')) encoded_message = base64.b64encode(encrypted) return encoded_message def decode(self, message): - decoded_message = electrum.bitcoin.aes_decrypt_with_iv(self.encode_password, self.iv, base64.b64decode(unicode(message)) ) + decoded_message = electrum.bitcoin.aes_decrypt_with_iv(self.encode_password, self.iv, base64.b64decode(message)).decode('utf8') return decoded_message - @hook def init_qt(self, gui): t@@ -246,5 +245,5 @@ class Plugin(BasePlugin): if force or not self.wallet.labels.get(key): self.wallet.labels[key] = value self.wallet.storage.put('labels', self.wallet.labels) - print_error("received labels") + print_error("received %d labels"%len(response)) self.window.labelsChanged.emit()