MultiStrings and ZipArchive

Colin Putney cputney at wiresong.ca
Sun Apr 17 00:07:18 UTC 2005


Hi Folks,

I'm investigating a Monticello bug report, and have discovered that 
it's actually a problem with ZipArchive. The problem arises if you add 
a MultiString as a member of a Zip archive, and then try to read it 
back. ZipArchive builds a String out of the bytes in the archive, with 
the result that it includes a lot of null characters, and any non-ascii 
characters get mangled.

Looking at how to fix this, it seems that, in general, we need to be 
more careful about using ByteArrays for binary data. The basic 
functionality of ZipArchive is byte-oriented, so its interface ought to 
accept and produce ByteArrays, though we can certainly put some helper 
methods on top of it to handle strings and encodings.

On the other hand, I don't know much about m17n, and there might be a 
better way to go. Anybody have thoughts on this?

Thanks,

Colin




More information about the Squeak-dev mailing list