[ python-Bugs-915942 ] CFStringGetUnicode() returns null-terminated
unicode string
SourceForge.net
noreply at sourceforge.net
Thu Jul 15 16:26:05 CEST 2004
Bugs item #915942, was opened at 2004-03-14 11:22
Message generated for change (Comment added) made by jackjansen
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=915942&group_id=5470
Category: Macintosh
Group: Platform-specific
>Status: Closed
>Resolution: Fixed
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???
#######
----------------------------------------------------------------------
>Comment By: Jack Jansen (jackjansen)
Date: 2004-07-15 16:26
Message:
Logged In: YES
user_id=45365
Fixed, both for 2.4 and 2.3.X.
----------------------------------------------------------------------
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