MacToISO is still confusing me

Graham Samuel livfoss at mac.com
Sun Dec 22 15:38:44 EST 2013


Thank Martin, that's helpful. I see that HTML is really the way to go. I am still puzzled by a number of things, but I trust these will become clearer when I do some more experimentation. For example:

- if any old PC can display pi (the Greek letter) etc as part of its ability to render web pages, the why aren't these symbols available to all users in whatever default font is used in browsers? The feeling is that the PC is saying "sure, I've got them in the box, but I'm not letting oddballs like you access them - whatever next?" 

- I now see how powerful the idea of htmlText is in extracting styled text from a field in LC (it really does the whole job for you, so I don't have to go through my old text by hand turning it into HTML, as I had thought), but I am still uncertain how to display that field in its full glory (i.e. including characters that aren't 'naturally' available in PC fonts) without using a browser.

- again, I am not keen on using Unicode for the simple reason that I don't understand LC's apparent ability to let one mix one-byte and two-byte characters; and if this is allowed, how character counting works in chunk expressions. But as I've said, I'll just use HTML if i can.

Thanks again for that good info. Back to the Brandy Butter.

Graham


On 22 Dec 2013, at 11:16, Martin Baxter wrote:

> Graham,
> 
> This page shows the differences between mac roman, ansi and iso-8891
> 
> <http://www.alanwood.net/demos/charsetdiffs.html>
> 
> You will see that PI characters are one of the numerous differences.
> obviously, mactoiso isn't magic and if there is no equivalent character
> in the set, it cannot help.
> 
> I use html references for this.
> 
> π or π gives lowercase pi
> Π or Π should give Capital PI
> 
> So you could
> 
> replace chartonum(185) with "π" in yourMacText
> 
> as a workaround. After putting yourMacText through mactosio() that is.
> You would then wrap paragraphs with <p> and </p> and anything else you
> need to do and then set the htmltext.
> 
> It will depend which version of livecode you are using. Recent versions
> support the above references in htmltext, but older versions did not.
> 
> I just tried these with livecode 4.5 and 6.1
> 
> The above work in 6.1, but not in 4.5 which appears to use [character
> position] mod 256 to produce an 8 bit value and displays the resulting
> completely incorrect glyph as if that was somehow a helpful thing to do.
> (e.g. π shows character 192 - Agrave instead of pi).
> 
> If you need to be thorough, you will want to cater for all the
> differences between the character sets as shown in the alanwood.net link
> above. What that page calls ANSI is, in practise, what mactoiso attempts
> to translate to.
> 
> It should be possible to deal with this by converting to some flavour of
> unicode I would think, but I can't help you with that.
> 
> Hope this helps
> 
> Martin BAxter
> 
> 
> 
> 
> On 21/12/13 22:48, Graham Samuel wrote:
>> In a last desperate attempt to avoid both HTML and Unicode in
>> translating just a few key characters from Mac to PC, I'm trying to
>> use the built-in function MacToISO, as suggested recently by Jacque
>> Gay.
>> 
>> Sadly I'm having trouble. Take the Greek letter pi, often used in
>> mathematics. There is a native Mac encoding for it, which turns out
>> to be decimal 185. But if you do this in the LiveCode message box
>> running on a PC:
>> 
>> put MacToISO(numToChar(185))
>> 
>> you don't get a pi symbol. This is not a good start.
>> 
>> The LC dictionary says that MacToISO translates those characters
>> whose codes are above 127 from the Mac encoding to the Windows Latin
>> 1 character set, which I assume is always available on PCs in Europe
>> and the US (and maybe everywhere else). When I look up this character
>> set in Wikipedia, it does contain the odd Greek letter, but not pi.
>> And in fact there are very few maths symbols (no 'less than or equal
>> to' or 'greater than or equal to', for example). So a lot of stuff
>> easily available on the Mac just isn't there on PCs.
>> 
>> I hadn't expected this - am I doing something wrong? Probably, but
>> I'd like to know what. Meanwhile, it's time for HTML, I suppose.
>> 
>> TIA for any clarification.
>> 
>> Graham _______________________________________________ use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list