From 9f3f5bce6f89045918ae9b7fede66abf0c51d59e Mon Sep 17 00:00:00 2001 From: Philippe Nunes Date: Thu, 26 Jul 2012 17:57:53 +0200 Subject: monitor-ofono: Fix to print non-English characters The default encoding for a Python bytestring is ASCII. But the SMS/USSD text is encoded in UTF-8. This is why trying to convert non-English characters (Unicode characters beyond 128) produces the error "UnicodeEncodeError: 'ascii' codec can't encode character". --- test/monitor-ofono | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/monitor-ofono b/test/monitor-ofono index 8570c341..dcc5ff5b 100755 --- a/test/monitor-ofono +++ b/test/monitor-ofono @@ -69,11 +69,11 @@ def event(member, path, interface): def message(msg, args, member, path, interface): iface = interface[interface.rfind(".") + 1:] print "{%s} [%s] %s %s (%s)" % (iface, path, member, - str(msg), pretty(args)) + msg, pretty(args)) def ussd(msg, member, path, interface): iface = interface[interface.rfind(".") + 1:] - print "{%s} [%s] %s %s" % (iface, path, member, str(msg)) + print "{%s} [%s] %s %s" % (iface, path, member, msg) def value(value, member, path, interface): iface = interface[interface.rfind(".") + 1:] -- cgit v1.2.3