characters lost pasting from Word To LiveCode field
admin at FlexibleLearning.com
Wed Dec 14 13:47:55 EST 2011
This scriptlet looks like a means of ensuring that accented and unicode
characters in plain text format transfer between platforms to me rather than
a bridge between text editors.
On Dec 13, 2011, at 9:02 PM, J. Landman Gay wrote:
> On 12/13/11 5:09 PM, Sieg Lindstrom wrote:
>> I'll say up front the details of text encoding are not my strong suit.
>> earlier versions (RunRev 4.x and earlier), I'd sometimes have to write
>> special routines to search and replace certain characters from the pasted
>> text. For example, the em-dash, "?" (chartonum 209), which after pasting
>> from Word was seen by RunRev as two characters (a two-byte character?),
>> numtochar of 32 followed by numtochar of 20 so I wrote a routine to just
>> search and replace to numToChar of 209. My new problem is that with
>> 5.0x (I just upgraded to 5.02), the em-dash if pasted from a Word file
>> instantly disappears from the text.
> Someone once posted a function to the list that translates Word text to
useable LiveCode text. I saved it but haven't ever tried it. I wish I'd also
recorded who wrote it:
> function revText theText
> return unidecode(uniencode(theText,"utf8"))
> end revText
> Use that on the clipboard contents and see if it does what you need.
No workie Jacque. From word I get empty. From Textedit I get ??? If I put
just the clipboardData from Word I get nothing. If I put the clipboardData
from Textedit I get an emDash. Bottom line: Microsoft does not play well
with Livecode's clipboard. Other apps are fine.
More information about the Use-livecode