When is Unicode not Unicode?

Devin Asay devin_asay at byu.edu
Wed Dec 18 11:56:32 EST 2013


On Dec 17, 2013, at 5:00 PM, J. Landman Gay wrote:

> On 12/17/13 5:48 PM, Graham Samuel wrote:
>> I have been trying to substitute Unicode characters in some text
>> which contains some mathematical notation originated on a Mac (where
>> several symbols like 'pi', 'less than or equals' etc are available as
>> standard) so as to make the text look OK on a PC. Not to bore people
>> with a lot of experimental data, but I find that a regular font on
>> the PC (the default one that LiveCode chooses for example) doesn't
>> seem to contain symbols like pi which I imagined could be shown using
>> the LC Unicode operations.
> 
> At least for pi, greater-than-or-equal-to, less-than, etc. they aren't really unicode (they don't use 2 bytes.) On Mac they're in the extended ascii table; pi, for example, is number 184. You could find out what character number it is on Windows and use numToChar to insert it.
> 
> Since they're such low numbers, comparatively speaking, I wouldn't think the font would matter. Unicode character numbers can be up in the thousands.

Another technique that works really well cross platform is to use html entities. That way you don't have to do trial and error with numToChar.

  set the htmlText of fld "foo" to "<p>My text with a π in it.</p>"

See a complete list of math and Greek symbols at http://www.w3schools.com/tags/ref_symbols.asp.

HTH

Devin

Devin Asay
Learn to code with LiveCode University
http://university.livecode.com





More information about the use-livecode mailing list