I always have to double check this as well. I think the point is that LC knows what its internal format is, but doesn't know what the source format is. So you always have to specify the 'external' format, but never the internal one.

With that in mind, it feels (at least in my language instincts) that if you're changing it out of the specified format, that's decoding; and vice versa. You have have to decode the text from UTF8 (or whatever) into the internal format; and encode it from the internal format into UTF8 (or whatever).

Ben

On 03/09/2021 03:55, J. Landman Gay via use-livecode wrote:
I made the same mistake at first. The concepts felt backward to me, it seemed like we should encode text into the format we were aiming for. So If I wanted UTF16 I should encode it that way. If I wanted UTF8 for outbound text I should decode the UTF16 that LC uses.

When the receiving server scripts went haywire I finally figured it out, but not before the Rails programmer wrote code to undo the gibberish I was sending.

--
Jacqueline Landman Gay | [email protected]
HyperActive Software | http://www.hyperactivesw.com
On September 2, 2021 7:55:45 PM Alex Tweedly via use-livecode <[email protected]> wrote:

i.e.I encoded it on the way in.

It should have been

   put textDecode(pStr, "UTF8") into pStr

With that changed, my tiny test script works properly



_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to