Byte order in unicode button labels

Dar Scott dsc at swcp.com
Mon May 8 15:24:14 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?

You might want to vote for enhancement 2825 that adds UTF-16BE and  
UTF-16LE to the uniEncode and uniDecode options.  This would allow  
you to store your favorite, say UTF-16BE, in your properties and then  
convert to host-order UTF-16 for unicodeText.  This might be a bit  
faster than storing UTF-8 in the property and then converting.

Dar


More information about the use-livecode mailing list