Elegant way to express constant UTF8 string in script?

Ben Rubinstein benr_mc at cogapp.com
Mon Jun 30 13:31:59 EDT 2014


On 30/06/2014 16:18, J. Landman Gay wrote:
> This is exactly what I've been dealing with for a week.  You need two steps : first check the platform and if it's Windows then run macToISO on the string.  After that your existing conversion to UTF8 should work.
>

Aha, good tip, thank you.

On reflection though I think I'm going to adopt a modified version of Peter's 
suggestion; use HTML entities in the 'constant' string to be unambiguous but 
readable, passing it through a function called "HTMLtoUTF8" so that bit of the 
script looks clean - and then do a nasty dirty implementation of that 
function, that just handles the two entities I currently care about and throws 
an error if invoked on anything else.

I'm all about the elegance, me.

thanks to all who responded,

Ben




More information about the use-livecode mailing list