1 message in org.python.python-bugs-list[ python-Bugs-915942 ] CFStringGetUni...
FromSent OnAttachments
SourceForge.netMar 14, 2004 5:22 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[ python-Bugs-915942 ] CFStringGetUnicode() returns null-terminated unicode stringActions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 14, 2004 5:22:44 am
List:org.python.python-bugs-list

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???

#######

----------------------------------------------------------------------