Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Thu Mar 27, 2014 8:59 pm
Hi All
I'm a little confused with MacToIso.
I read in the doc:
Characters whose ASCII value is less than 128 are the same in the Mac OS character set and Windows Latin 1, so they are not changed by the macToISo function.
I use chartonum(1) like itemdel and it seems it is changed by the macToISo function
On Mac: MacToIso(numtochar(1)) = "ä" (ascii = 138)
When i open the stack on windows (numtochar(1) appear like a kind of S with an inverse circumflexe (ascii = 138)
Thanks for your lights
Best regards
Jean-Marc
https://alternatic.ch
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Fri Mar 28, 2014 12:42 pm
Hi Jean-Marc,
MacToIso/IsoToMac is for converting texts, not binary data. Try converting the items, not the itemDelimiters.
I must admit that it is slightly odd that isoToMac/macToIso alters the control values, but I'm not really surprised. Just don't convert chars 1 to 31.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Fri Mar 28, 2014 6:20 pm
Hi Mark,
Thanks for your comment
I experiment the conversion from mac to windows which converts automaticaly the content of fields where I use numtochar(1) like itemdel.
Replacing numTochar(138) with numtochar(1) at the first open when the platform = "win32" seems working.
Kind regards
Jean-Marc
https://alternatic.ch
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Fri Mar 28, 2014 6:58 pm
Hi Jean-Marc,
I think I misunderstood your original question. You mean that ASCII 1 is converted to ASCII 138 when you move your stacks from Mac to Windows. That shouldn't happen. I think this should be reported as a bug.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Fri Mar 28, 2014 10:32 pm
Hi All
Is there someone to confirm this result before sending
a message to the quality center ?
Thanks
@Mark
Thank again for spend time to examine my bad english and also to share my confusion about macToIso in this case
Kind regards
Jean-Marc
-
Attachments
-
- TestmacToIsoNumToChar1.livecode.zip
- (919 Bytes) Downloaded 157 times
https://alternatic.ch
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Sat Mar 29, 2014 7:27 pm
According to an ASCII chart I have, some characters below ASCII 32 have values on Windows but no value on Mac, and ASCII 1 is one of those. So I think macToISO is doing the correct thing.
To be safe, use a character that is the same on both Mac and Windows. These include ASCII 3,8, and 22 -31. I usually choose ASCII 8 (the delete key) because the user cannot type it so I am sure it will never be in the text I'm parsing. I also like ASCII 3 (enter key) for the same reason.
Or you can do the conversion from 138 to 1 as you are doing now, which reverses the macToISO change. But it is easier to choose a character that won't change at all.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Sat Mar 29, 2014 7:42 pm
Jacque,
Those characters that have no value are control characters. They used to make the punch reader ring a bell and such things. They do have a value on Mac according to the ASCII charts I have, but you can't see them.
You can't convert ASCII 138, because there are languages using this character in normal texts. Assuming that ASCII 138 is the same as ASCII 1would corrupt the data.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Sat Mar 29, 2014 8:00 pm
The MetaCard character viewer reports those as "Windows only" characters, which implies to me they have different values in WIndows than in Mac. I know what control characters are, but apparently Windows uses some of those differently now that we are no longer using teletype machines.
I have had good success using the characters in that chart that report compatibility in both Mac and Windows.
Edit: I shouldn't say "different values", I should have said "different uses". Naturally the numerical value doesn't change.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Sat Mar 29, 2014 10:12 pm
Jacque,
Thanks for your lights.
I usually choose ASCII 8 (the delete key) because the user cannot type it
I choosed ASCII 1 for the same reason
Mark,
You can't convert ASCII 138, because there are languages using this character in normal texts. Assuming that ASCII 138 is the same as ASCII 1would corrupt the data.
You're right I can do that for english and french but not for german neither for others langages.
Do you think it justifies a note in the LC dictionary ?
Kind regards
Jean-Marc
https://alternatic.ch
-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Fri Sep 19, 2014 5:59 pm
Hi All
Sorry. I forgot giving some news about this thread
Finally I choosed "©", numtochar(169) instead "ä" numtochar(138) as itemdel
Best regards
Jean-Marc
https://alternatic.ch