[ python-Bugs-915942 ] CFStringGetUnicode() returns null-terminated
unicode string
SourceForge.net
noreply at sourceforge.net
Sun Mar 14 05:22:59 EST 2004
Bugs item #915942, was opened at 2004-03-14 10:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=915942&group_id=5470
Category: Macintosh
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: has (hhas)
Assigned to: Jack Jansen (jackjansen)
Summary: CFStringGetUnicode() returns null-terminated unicode string
Initial Comment:
Carbon.CoreFoundation CFStringGetUnicode() wrapper returns a
null-terminated unicode string. Example:
#######
#!/usr/local/bin/pythonw
import Carbon.CoreFoundation as CF
from appscript import LaunchServices
path = 'TextEdit.app'
fURL = LaunchServices.LSFindApplicationForInfo ('????', None,
path)[1]
print [c for c in
(fURL.CFURLCopyFileSystemPath(CF.kCFURLPOSIXPathStyle).CFSt
ringGetUnicode())]
--> [u'/', u'A', u'p', u'p', u'l', u'i', u'c', u'a', u't', u'i', u'o', u'n', u's',
u'/', u'T', u'e', u'x', u't', u'E', u'd', u'i', u't', u'.', u'a', u'p', u'p', u'x00'] -- why is last character 0x00???
#######
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=915942&group_id=5470
More information about the Python-bugs-list
mailing list