Mac / ISO XML - dumb question

Martin Baxter martin at materiaprima.fsnet.co.uk
Wed Mar 23 04:00:47 EST 2005


>Op 19-mrt-05 om 16:25 heeft jbv het volgende geschreven:
>
>> Hi all,
>>
>> I'm working on a website project using Rev cgi in which
>> data will be sold online and available as xml files to be
>> downloaded by customers.
>> It seems that xml files suffer the same problem as plain
>> text files : according to the client platform to which they'll
>> be downloaded, end users need to have the choice between
>> a Mac or ISO version... Or is there a way to make xml files
>> all-platforms compatible ?
>
>You are talking about upper ASCII chars, because with 'normal' chars
>you wouldn't notice the difference between Mac or ISO.
>
>Many of these upper ASCII chars can be typed as ë or { (the
>latter form is preferred). XML in RunRev does that automatically, or it
>chokes on these upper ASCII chars.
>
>Upper ASCII chars in XML in RunRev is not completely bug-free. It
>handles 'ë' nicely, but can't handle 'ä' for example.
>
>Terry

Though it's not directly relevant to the practical issue of this thread, I
happened to be using the transcript function mactoiso() yesterday and
discovered that, (contrary to what it says in my version of the docs), it
is not only character codes >127 that are affected by that function.

in mactoiso the remapping affects many control characters in the range 1-21.
I used the following handler to investigate.

on mouseup
 repeat with i = 1 to 31
  put i into item i of startcodes
 end repeat
 repeat for each item i in startcodes
  put numtochar(i) & comma after startchars
 end repeat
 delete last char of startchars
 put mactoiso(startchars) into endchars
 repeat with i = 1 to 31
  put item i of startcodes & " = "\
   & chartonum(item i of endchars) into line i of output
 end repeat
 put output
end mouseup

Of these, the codes that come through unscathed are 8,9,10,13 and 22-31 all
the others end up as "high ascii" codes.

What alerted me to this was using mactoiso on a string containing VT as a
stand-in line-delimiter. This got changed to char 188 - the 1/4 fraction in
iso. This surprised me. I think the reason must be because these character
positions have historically been used by specialist mac fonts for various
mathematical and icelandic characters.

I now know to substitute any VT characters *before* passing the string
through mactoiso.

No doubt the same caution applies to isotomac().

Esoteric? Yes, but definitely worth knowing if you are in the habit of
using VT this way.

Martin Baxter




More information about the use-livecode mailing list