cross-platform compress & decompress

Richard Gaskin ambassador at
Mon Dec 1 17:27:44 CST 2003

Alex Rice wrote:

> On Dec 1, 2003, at 4:19 PM, Mark Brownell wrote:
>> I've read everything I can find in the archives and I'm wondering if
>> anyone has solved the cross-platform compress & decompress problems. I
>> would like to create a compressed text file on Mac X and open &
>> decompress it on Windows, the same goes for make on Windows & open on
>> Mac. I'm not sure but it looks like the different charSets for each OS
>> seems to be the problem. Anyway when I try to open made on Mac in
>> Windows the file is not recognized as being compressed. I've tried
>> stripping the header before decompressing with no luck. Perhaps a
>> cross-platform compress/decompress is in the works soon? I solved
>> these charSet OS issues in cross-platform encryption by converting to
>> numbers within the entire encryption/decryption process. This took the
>> relative positions of the different chars in charSets out of picture
>> until the final rendering takes place.
> Would base64 encoding the content before compressing it be a suitable
> workaround for the char set issues?
> Is there a bugzilla # I can read to get up to speed on this bug?

I don't think it's a bug as much as a very useful feature with unintended
consequences for binary data:  in old versions of the engine, folks
complained that data stored in user properties did not have the automatic
cross-platform conversion as text in fields enjoy.  So several versions ago
this was changed to allow the same for user props.

The downside to the change is that for the minority of user props containing
binary data this conversion will cause trouble, often making the data
unusable (as is the case if the data is compressed).

Maybe we need a flag to note whether a property is text or binary?  Should
it be a stack property?

 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge: Publish any database on any Web site
 Ambassador at
 Tel: 323-225-3717                       AIM: FourthWorldInc

More information about the use-livecode mailing list