On November 19, Peter Gatti wrote:
I went nuts trying to figure out why just a few text strings were
screwing-up a binary file. I finally figured out why. It turns out, only
those strings that had a meta or option key character in them were the
ones responsible.
I doubt that I'm doing anything wrong because the other strings save
without a problem. So is this a bug or just an RB limitation?
Yes -- I ran into the same problem, corrupting some or all byte values with
the first bit set (ASC values > 127).
Evidently RB cannot write strings as pure binary data. It insists on
performing some kind of text conversion -- even when writing to a binary file.
This may be considered a "feature," not a bug. To me, however, the whole
point of a binary file is to store data in the form we choose -- not
"converted" as somebody else sees fit.
In my case, my program is producing an RTF file, and the text conversion
being "helpfully" interposed by RB resulted in corruption of the file. As
a work-around, I was forced to loop through every output string, byte by
byte, writing each byte individually. Perhaps there's a better way.
Christopher
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|