Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extract text out of NSAppleEventDescriptor



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'
(gdb) p (char)[returnObject characterAtIndex:2]
$3 = 0 '\000'
(gdb) p (char)[returnObject characterAtIndex:3]
$4 = 101 'e'
(gdb) p (char)[returnObject characterAtIndex:4]
$5 = 0 '\000'
(gdb) p (char)[returnObject characterAtIndex:5]
$6 = 116 't'
(gdb)


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.

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/email@hidden

This email sent to email@hidden


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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.