Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Extract text out of NSAppleEventDescriptor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extract text out of NSAppleEventDescriptor



On 2007-02-11, at 13:36, has wrote:

Ivan C Myrvold wrote:

Looks like the string is not empty at all. The length of the string is correct, 188, but when I look at the chars, they alternate between 0 and the chars ASCII code:

NSString* returnObject = [[[replyDescriptor descriptorAtIndex:1]
descriptorAtIndex:1] stringValue];

(gdb) p (char)[returnObject characterAtIndex:0]
$1 = 0 '\000'
Current language:  auto; currently objective-c
(gdb) p (char)[returnObject characterAtIndex:1]
$2 = 68 'D'

Sounds a bit suspect - where's the descriptor coming from? Could be that the source is packing UTF16 data into a descriptor with type typeChar/typeUTF8Text instead of typeUnicodeText/ typeUTF16ExternalRepresentation.

Certainly looks like it.


Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Extract text out of NSAppleEventDescriptor (From: has <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.