in reply to Re: int to ascii
in thread int to ascii
What I do not understand is why it works. Page 757 of Camel3 says that pack "takes a LIST of ordinary Perl values and converts them into a string of bytes."use strict; my $foo = pack("cccc",65,66,67,68); print $foo;
Now who says that "A" is a byte? Maybe my operating system uses Unicode and "A" is two bytes. Isn't ASCII a 7-bit encoding scheme? (A byte is eight bits, not 7.)
So why do the bytes that pack returns necessarily print out as 'ABCD' and not as gibberish?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: int to ascii
by chipmunk (Parson) on May 08, 2001 at 19:22 UTC |