Hi Ole, 2011/12/7 Ole Nielsen <ole.moller.niel...@gmail.com>: > Thanks for that - I wouldn't have known where to look. But this does the > trick - although for my application I did have a need to explicitly convert > the QString types to unicode. > I looked at methods toAscii() and toLatin1() but neither produced the python > string types I was expecting. Can you comment on that?
To convert QString into Python string use str() or unicode() functions. For example, in code attrs = feat.attributeMap() for (k,attr) in attrs.iteritems(): name = fields[ k ].name() print "%s: %s" % (name, unicode(attr.toString())) # print "%s: %s" % (name, str(attr.toString())) -- Alexander Bruy NextGIS _______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer