Re: Binary Large Objects (BLOB) decoding



Tom Allison wrote:
> I'm making a crude attempt to parse through some database BLOBS with
> some success. Some of the information is in XML format, some in
> "text". But a lot of crud exists because of the binary characters.
>
> I originally tried this:
>
> my $ascii = unpack("A*", $blob);

The only modification the "A*" format does is remove trailing whitespace.


> but with limited success. At least it keeps the application from
> crashing. But it would be really useful if I could so something along
> the lines of replacing certain key combinations with a simple '\n'
> or similar.

You probably need to use either the substitution or transliteration operators.


> I'm also not exactly sure what the characters are that I'm seeing.
> 'less' says that a lot of them are <C0><80> which don't appear be on
> my ascii table of characters....

That is because ASCII only refers to the characters in the range 0x00 - 0x7F.



John
--
use Perl;
program
fulfillment
.