Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Welcome to the Monastery
 
PerlMonks  

RE: RE: Chr and Ord

by sean (Beadle)
on Jun 16, 2000 at 01:42 UTC ( [id://18425]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to RE: Chr and Ord
in thread Chr and Ord

Apparently, chr() gleefully discards all but the 8 least signifigant bits. (ascii characters are normally represented by 8 bits, btw. 2**8 = 256)
sean@strange:~$ perl -e 'print chr(80) . "\n"' P sean@strange:~$ perl -e 'print chr(80+256) . "\n"' P sean@strange:~$ perl -e 'print chr(80+256+256) . "\n"' P

Replies are listed 'Best First'.
RE: RE: RE: Chr and Ord
by Ovid (Cardinal) on Jun 16, 2000 at 04:38 UTC
    Thanks for explaining what was going on for chr()

    Regarding the 7-bit/255 characters thing, I can only plead temporary stupidity. The standard ASCII set (as defined by ANSI) is 128 7-bit characters. This link will take you to that set. Notice that it only goes up to x7E. If the eighth bit is set, then you hit the extended ASCII set. I found a few references to it, the clearest I found is at this link.

    Of course, this is only a feeble attempt at backpedaling :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://18425]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.