A bit RTF-ed off.

Kay C Lan lan.kc.macmail at gmail.com
Fri Jul 8 23:13:26 EDT 2016


As I assume you are now using LC8 Indy (to that generous person, God
bless you and your family) I'll point out two entries in the LC8
Dictionary which I know you're having trouble accessing:

Under 'textDecode':

It is highly recommended that any time you interface with things
outside LiveCode (files, network sockets, processes, etc) that you
explicitly textEncode any text you send outside LiveCode and
textDecode all text received into LiveCode. If this doesn't happen, a
platform-dependent encoding will be used (which normally does not
support Unicode text).

It is not, in general, possible to reliably auto-detect text encodings
so please check the documentation for the programme you are
communicating with to find out what it expects. If in doubt, try
UTF-8.

Under 'RTFText':

Note: Unfortunately, OpenOffice does not have particularly good rtf
import / export capabilities (it doesn't even round-trip correctly
through itself!) and thus copying / pasting of lists between LiveCode
and OpenOffice will not work reliably or correctly.

Important: Because the RTF standard does not include the box,
threeDbox, and link styles supported by LiveCode, the RTFText property
does not necessarily include all information necessary to reproduce
the style information in a chunk. To export and re-import field
information without losing any style information, use the
htmlTextproperty instead.

So I think your script should look something like:

set the RTFText of fld "myRTF" to textDecode(myFile,"CP1252")

Obviously CP1252, could be UTF-16BE, UTF-8, ASCII or any of the other
recognised formats like "ISO-8859-1" which I see is a Linux only
format.

HTH




More information about the use-livecode mailing list