Hi All
With this code I am trying to get the path in const char *pathPtr from fsRefAEDesc. It gives the correct name and path if there are no special characters in the name of file which is there in fsRefAEDesc. Now if path has some special characters /Users/XYZ/.rtf I don't get a correct fsRef from AEGetDescData(). I believe it has some thing to do with Encoding and tried some them but could make it work.
FSRef fsRef;
//AEDesc fsRefAEDesc; //comes from some where.
status = AEGetDescData( &fsRefAEDesc, (void*)(&fsRef), sizeof(FSRef));
//OSErr result = FSMakeFSRefUnicode(&fsRef, 1024, (UniCharPtr)(&fsRef), kTextEncodingUnknown, &fileRef);
AEDisposeDesc( &fsRefAEDesc );
CFURLRef* gotURLRef = CFURLCreateFromFSRef(NULL, &fsRef);
CFStringRef macPath = CFURLCopyFileSystemPath(gotURLRef, kCFURLPOSIXPathStyle);
const char *pathPtr = CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding());
Is there is any way to read such paths?
Thanks in advance!
M