Post
by LCMark » Thu May 08, 2014 9:13 am
@monte: The reason I did it that was to make arrays going in and out symmetric... There's no way for an array coming from LiveCode going to an external to know whether it should encode its elements as data or string (there's no distinction in the current pre-7.0 engine) -- however, on reflection, this probably being a little too conservative so making it so that NSData gets stored as binary data when going back into LiveCode does no harm.
In terms of LC7 - yes, the externals interface (when it arrives!) in LC7 will promote 'string' to 'unicode string'. If a variable (or element) holds a String unicode will pass through to NSString, and if a variable (or element) holds a binary string it will pass through to NSData. Note that because in LC7, binary strings and text strings are distinguished in the engine then the array conversion can be symmetric. [ We can put in the external glue code the compatibility conversion of natively encoded strings being treated as either a text string or binary data - it will depend on how you request the contents ].