in reply to Re: Unpacking variable length bit fields
in thread Unpacking variable length bit fields
Oops, I spoke to soon. The field length specifies the number of bits (multiple of 8) but I want to extract the fields themselves as bytes not as bit strings of 1/0's.
My problems is that using something like: unpack('C/C'...) would unpack C bytes for each filed rather than C bits for each field which is what I want. So I really would like to divide by 8 but I'm not sure how to do that. I imagine I could unpack as a bit string of 1/0's then split, then repack but that seems klugey.
It's a screwy format, but I don't have control over it....