All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] monitor-ofono: Fix to print non-English characters
@ 2012-07-26 15:57 Philippe Nunes
  2012-07-26 15:57 ` [PATCH v2] test-ussd becomes send-ussd This script can be used to handle network initiated USSDs Philippe Nunes
  2012-07-27  5:34 ` [PATCH] monitor-ofono: Fix to print non-English characters Denis Kenzior
  0 siblings, 2 replies; 4+ messages in thread
From: Philippe Nunes @ 2012-07-26 15:57 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]

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(-)

diff --git a/test/monitor-ofono b/test/monitor-ofono
index 8570c34..dcc5ff5 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:]
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-27  5:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-26 15:57 [PATCH] monitor-ofono: Fix to print non-English characters Philippe Nunes
2012-07-26 15:57 ` [PATCH v2] test-ussd becomes send-ussd This script can be used to handle network initiated USSDs Philippe Nunes
2012-07-27  5:36   ` Denis Kenzior
2012-07-27  5:34 ` [PATCH] monitor-ofono: Fix to print non-English characters Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.