The Euro symbol

Devin Asay devin_asay at byu.edu
Mon Aug 4 12:58:48 EDT 2008


On Aug 4, 2008, at 1:20 AM, Sarah Reichelt wrote:

> Hi people,
>
> Can anyone give me some advice on the cross-platform issues with the
> Euro symbol?
>
> On my Mac, numToChar(216) gives the Euro symbol, but on my Windows
> virtual machine, that doesn't work, but numToChar(128) does. Is this
> correct for all varieties of Windows?
>
> I am helping with an app that switches currencies and is
> cross-platform. The currency symbol occurs in fields all over the app
> so it takes a while to change. Before building a standalone, we set
> the symbol as required, then build the version for that currency. Now
> it appears that we have to set the euro symbol to one thing, build for
> Mac, then set it to something else and build for Windows.
>
> Surely there has to be an easier, more standard way to handle the  
> Euro symbol?

I'd use one of two methods:

1. The html entity for the Euro symbol is "¤"
Save this as a custom property of the field, say the euroSymbol of fld  
"currency"
Then set the htmlText of the field:
   set the htmlText of fld "currency" to the euroSymbol of fld  
"currency"

2. Use unicode. I'd use UTF-8 to avoid cross-processor endian issues.  
Here is the UTF-8 version of the Euro symbol (as expressed in ASCII on  
my Mac): "€"
Save it in a custom property as before and do this:
   set the unicodeText of fld "currency" to uniencode(the  
uniEuroSymbol of fld "currency","utf8")

Just set a flag for your whole app that determines which currency  
system you'll be using, then check the flag and set the field on each  
card in a preOpenCard handler.

HTH,

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list