K
kerry.baker
I have a strange problem. I have a need to convert the value of a byte
read from a file to its integer string counterpart. (e.g. the byte
contains 0x1d and it prints out 29.)
I use this to do it:
$value = unpack ("c",substr($_, 259, 1));
This seems to work just fine for all values except 0x0a which returns
32 instead of 10.
Why does this happen?
I wrote a similar script using awk which also returned 32 instead of
10.
It seems so odd to me. 0x0b returns 11 which is correct as does all
other values.
Any ideas greatfully accepted!
read from a file to its integer string counterpart. (e.g. the byte
contains 0x1d and it prints out 29.)
I use this to do it:
$value = unpack ("c",substr($_, 259, 1));
This seems to work just fine for all values except 0x0a which returns
32 instead of 10.
Why does this happen?
I wrote a similar script using awk which also returned 32 instead of
10.
It seems so odd to me. 0x0b returns 11 which is correct as does all
other values.
Any ideas greatfully accepted!