A task for Binary decode?

Dar Scott dsc at swcp.com
Tue Aug 12 15:45:00 EDT 2003


On Tuesday, August 12, 2003, at 03:22 PM, jbv wrote:

> At first glance, the data looks like octal (base 8), and therefore
...
> But I'm somewhat puzzled by things like Exif or MM in the
> code...

It may be that the binary blob was forced to ASCII printable to be 
saved in the database.  Those bytes that are already in that range, 
such as MM are left as they are.  It looks like there might be some 
null terminated strings in the data, also, and those are printable 
ASCII.  I suspect that those bytes outside the printable ASCII range 
are encoded as \nnn where nnn is the octal representation of the byte.

If so, the conversion from the database form to the raw binary may 
simply be this:

    put format(asciifiedData) into binaryData

I didn't see any indication of this, but there might be some constraint 
as to a maximum line length in the database and some line-end is 
inserted to comply.  Those should be removed before the format() is 
applied.

The binary data is then available for use as binary as a whole.  If 
parts are needed, then binaryDecode() can be used, but if not, then it 
will not be needed.

Dar Scott
****************************************
     Dar Scott Consulting
     http://www.swcp.com/dsc/
     Programming Services
****************************************




More information about the metacard mailing list