Byte order in unicode button labels

Dar Scott dsc at swcp.com
Fri May 5 18:11:00 EDT 2006


On May 5, 2006, at 12:47 PM, Devin Asay wrote:

> I am writing an app with button labels in a non-Latin script  
> (Cyrillic). Under certain conditions I need to change the label of  
> these buttons. To do so I store the unicode text of the different  
> label names in custom properties. But I just discovered that the  
> byte order is swapped between Win and Mac (okay, I'm slow.) I can  
> just store custom props with the different label variants for both  
> mac and win, but that would be an inelegant kludge. Is there a way  
> to reverse the byte order of unicode strings in Rev?

Consider storing the string as UTF-8 in the properties and apply  
uniEncode() to generate the host-order UTF-16.  That avoids the problem.

Dar Scott







More information about the use-livecode mailing list