Clive Walden wrote: >>But I'm curious why an assumption like this (1 byte == 1 character) >>would simplify your record packing problem. > > It is not the "coding" that concerns me, it is the storage. > > I have to pack a huge amount of data into the Palm. Unless I am > fundamentally mistaken, double byte characters will require twice > as much storage per string as single byte characters.
If you have to pack a huge amount of data in, then you probably want to use compression anyway, in which case whether characters are 1 byte or 2 bytes or 10 bytes won't be nearly as important. Compression won't make the storage size totally independent of the way it's coded, but it will get fairly close if it's decent compression. Even if you find you do need to use 2-byte characters, there's a chance you won't have more than 256 unique characters in the character set used for your input text. So, if you really want, you could do a one-to-one mapping to one-byte characters. You could do this by itself, or you could even do it as a pre-processing step before compression. Oftentimes, there are simple transformations you can do to data in advance to put it in a form that a compression algorithm can compress better, and converting multi-byte characters to single-byte would be such a case. However, as I implied above, the gains are probably not great at all, so it may not be worth it. - Logan -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
