From 65ca70d29f55468a3f8d1754dbdb5f690e7575e2 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Mon, 27 Feb 2006 18:07:38 +0000 Subject: [PATCH] encode, only when result is unicode --- src/gajim-remote.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gajim-remote.py b/src/gajim-remote.py index 372ca8cd8..d01311f08 100755 --- a/src/gajim-remote.py +++ b/src/gajim-remote.py @@ -253,7 +253,10 @@ class GajimRemote: elif self.command == 'list_accounts': if isinstance(res, list): for account in res: - print account.encode(PREFERRED_ENCODING) + if isinstance(account, unicode): + print account.encode(PREFERRED_ENCODING) + else: + print account elif self.command == 'account_info': if res: print self.print_info(0, res, True) @@ -265,7 +268,10 @@ class GajimRemote: pref_keys.sort() for pref_key in pref_keys: result = '%s = %s' % (pref_key, res[pref_key]) - print result.encode(PREFERRED_ENCODING) + if isinstance(result, unicode): + print result.encode(PREFERRED_ENCODING) + else: + print result elif self.command == 'contact_info': print self.print_info(0, res, True) elif res: