gettingstarted
[Top] [All Lists]

Re: Option Characters to binary

To: "Getting Started" <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Option Characters to binary
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Wed, 19 Nov 2003 16:16:06 -0600
References: <200311191406 dot hAJE6ONp019178 at mtac1 dot prodigy dot net> <6 dot 0 dot 1 dot 1 dot 2 dot 20031119133809 dot 01e321d8 at postoffice dot pacbell dot net>
At 2:06 PM -0800 11/19/03, Christopher Morrill wrote:

 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).

Under what circumstances?

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.

Not true. The contents of a string are written out to a file exactly as they are, byte for byte.

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.

We agree.

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.

RB interposes no text conversion.

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.

There is indeed. Please post a simple example of what you think is going on, and perhaps we can shed some light on it.

Best,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>