Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Chr and Ord

by BigJoe (Curate)
on Jun 16, 2000 at 02:48 UTC ( [id://18412]=note: print w/replies, xml ) Need Help??

in reply to Chr and Ord

Both of these commands use standard ASCII no matter what OS the command chr will use an ASCII lookup table and same with the ord command.

--Big Joe

Replies are listed 'Best First'.
RE: Re: Chr and Ord
by lhoward (Vicar) on Jun 16, 2000 at 06:20 UTC
    Not true... If your platform uses a character set other than ASCII, chr and ord may behave differently:
    On these platforms, bear in mind that the EBCDIC character set may have an effect on what happens with some perl functions (such as chr, pack, print, printf, ord, sort, sprintf, unpack), as well as bit-fiddling with ASCII constants using operators like ^, & and |, not to mention dealing with socket interfaces to ASCII computers (see NEWLINES).
    Lifted from perlport. Also see the following quote from the same document:
    Assume very little about character sets. Do not assume anything about the numerical values (ord(), chr()) of characters. Do not assume that the alphabetic characters are encoded contiguously (in numerical sense). Do no assume anything about the ordering of the characters. The lowercase letters may come before or after the uppercase letters, the lowercase and uppercase may be interlaced so that both 'a' and 'A' come before the 'b', the accented and other international characters may be interlaced so that comes before the 'b'.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://18412]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-25 15:08 GMT
Find Nodes?
    Voting Booth?

    No recent polls found