LiveCode Fields - Mac Roman ANSI Characters and Unicode

Brahmanathaswami brahma at hindu.org
Sat Sep 19 16:00:39 EDT 2015


bottom line question:

Is LC automatically transforming all the 128-255 ANSI chars to their 
unicode equivalents?  as per this chart:

http://www.alanwood.net/demos/macroman.html

??

Back story:

For years I have struggled with getting MacRoman ANSI characters like 
Curly quote(s) and MDashes which are called on the Mac Keyboard with 
e.g. shift-option-dash... In the old days this would produce.. if you 
ran a charToNum function on it you would get 209 for mdash...

Once again, circa 2015 I am faced with text that contains both unicode 
compliant UTF-8 strings AND  macRoman ANSI in the same paragraph...

But...if I import that text into an LC field using "set the html text" 
to that same chunk which include the ANSI character... I am seeing the 
mdash properly displayed and the curly quotes and apostrophe's

Now, and this is the interesting part:  in LC7.1 RC3 if copy that from 
LC, open a browser, go to PHPMyAdmin and paste into a column/field  I am 
getting what appears to me fully unicode compliant text!

Since the screen is rendering the characters as expected.. I can't 
really tell though.. I don't know how to analyze the string to see if it 
is 100% unicode... but my "gut" is telling me that perhaps  LC is auto 
transforming  the old 209 to the new unicode —  for that character 
"on it's own," so to speak.

If so, this is "huge" for me... good news... but we are still having 
problems with "POST" to get that same text into the database...

I've tried the clipboardData["unicode"]

But I think Jacque clued me in and the way to go is to do

textEncode (the clipboardData["text"], "UTF-8") into tDataToPost

and *then* post it to the API that will insert it into mySQL

Also... if any one has any advice on how to handle the post on the LC 
server side to preserve the UTF-8 string for insertion (RevIgniter 
Active database library) that will also help.

But the POST is a separate issue... I first want to understand what LC 
is doing in these fields with the "old" ANSI chars on the Mac?

Swasti Astu, Be Well!
Brahmanathaswami

Kauai's Hindu Monastery
www.HimalayanAcademy.com





More information about the use-livecode mailing list