On May 8, 2005, at 6:40 PM, Florian Munz wrote: > Nicholas Riley <[EMAIL PROTECTED]> wrote: > > >> In [3]: plist, format, error = >> NSPropertyListSerialization.propertyListFromData_mutabilityOption_for >> ma >> t_errorDescription_(NSData.dataWithContentsOfMappedFile_ >> (os.path.expand >> user('~/Library/Preferences/com.apple.keychainsync.plist')), >> NSPropertyListImmutable, 0) >> >> In [4]: plist Out[4]: {KeychainSyncList = (); } >> >> In [5]: data, error = >> NSPropertyListSerialization.dataFromPropertyList_format_errorDescript >> ion_( >> plist, NSPropertyListXMLFormat_v1_0) >> >> [...] >> > > thanks, that works exactly the way I need it. I found out you can get > the string faster if you convert the NSData right away: > > s = NSString.alloc().initWithData_encoding_(data, > NSUTF8StringEncoding)
There's plenty of other ways to say that.. In 1.3 you should be able to do this: s = unicode(buffer(data), 'utf-8') Or before you could do: s = unicode(data.bytes(), 'utf-8') -bob _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig