test: Fix Text NDEF representation
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 12 Jun 2013 15:07:39 +0000 (17:07 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 12 Jun 2013 15:09:42 +0000 (17:09 +0200)
The Text NDEF representation could be non ASCII strings (UTF-8 or
UTF-16) and the dumping scripts need to know about that.

Fixes #NFC-48

test/dump-record
test/dump-tag

index 8cf3cb1..2b7c187 100755 (executable)
@@ -20,5 +20,8 @@ properties = record.GetProperties()
 print "[ %s ]" % (sys.argv[1])
 
 for key in properties.keys():
-    val = str(properties[key])
-    print "      %s = %s" % (key, val)
+       if key in ["Representation"]:
+               val = unicode(properties[key])
+       else:
+               val = str(properties[key])
+       print "      %s = %s" % (key, val)
index 8ce8d6b..efdd14f 100755 (executable)
@@ -22,7 +22,10 @@ def extract_record(key, list):
                print "        Record = [ %s ]" % (str(i))
 
                for key in properties.keys():
-                       val = str(properties[key])
+                       if key in ["Representation"]:
+                               val = unicode(properties[key])
+                       else:
+                               val = str(properties[key])
                        print "              %s = %s" % (key, val)
 
 tag = dbus.Interface(bus.get_object("org.neard", sys.argv[1]),