Byte order in unicode button labels

Mark Smith mark at maseurope.net
Fri May 5 15:30:30 EDT 2006


Not certain that this is the appropriate or best way to deal with it  
(I know little about unicode), but just to swap the bytes (this sort  
of thing has worked well for me when dealing with binary numbers):

function swapBytePairs pString
   repeat with n = 2 to length(pString) step 2
     put char n of pString & char n-1 of pString after swappedString
   end repeat
   return swappedString
end swapBytePairs

Best,

Mark

On 5 May 2006, at 19:47, 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?
>
> Devin
>
> Devin Asay
> Humanities Technology and Research Support Center
> Brigham Young University
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list