Encoding Arrays with File Paths

Bob Sneidar bobsneidar at iotecdigital.com
Tue Feb 18 17:39:38 EST 2025


Thanks Monte. 

Here is what I am doing: 

I have a numbered array. Element 0 has a key called operation which simply has a string with one of several possible values. 

Then I have elements 1 to n with a number of different elements, most are simple strings, but one key is the binary file data of a file that has been encrypted using LC’s built in library. 

Before I send the file over a socket, I base64encode it. I verified that the base64encoded string on the receiving end matches the one on the sending end. 

Curiously however I cannot even arrayDecode right after I arrayEncode and have it work so something is getting corrupted by the array encode / decode functions. 

I think what I will have to do is start commenting out different elements to see which one is the issue. It may well be the file data. 

Bob S


> On Feb 18, 2025, at 2:15 PM, Monte Goulding via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 
> 
>> On 19 Feb 2025, at 9:09 AM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Okay I don’t think I am having an issue with arrayEncode. I think I am having an issue where arrayEncoding with MacOS is failing to arrayDecode in Windows and vis versa.
> 
> The result of arrayEncode is a binary string so you need to ensure it is not treated as text either writing it out or reading it in. For example if reading or writing to disk use a `binfile:` url or binary mode on open file.
> 
> Cheers
> 
> Monte
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list