convert hex string to ascii [message #53368] |
Sat, 07 April 2007 08:42 |
rkombiyil
Messages: 59 Registered: March 2006
|
Member |
|
|
Dear list members,
Sorry to bother with a trivial (?) question.. I was wondering if there
is a way to convert a hex byte string to corresponding ascii string?
i.e., 'ABC ' would be coded as:41424320 (long int), I need to convert
this back as ascii..
What I did was to read in the corresponding long integer
representation and then use the "Z" format specifier to get the hex
representation and look up the "ASCII" table for the characters. But
in this case, the order in which these (ascii characters comprising
the string) appear reversed (?!, i.e., 'ABC ' as ' CBA'), which I
suspect is due to the way hex is computed from its corresponding
binary representation?
I am confused. Any suggestions / where can I find some examples to
clear up this hex muddle in my head? :-(
tia,
/rk
|
|
|