On Tue, Mar 27, 2001 at 12:38:23PM -0500, Dan Sugalski wrote:
> I'm afraid this isn't what I'd normally think of--ord to me returns the 
> integer value of the first code point in the string. That does mean that A 
> is different for ASCII and EBCDIC, but that's just One Of Those Things.

My personal take is that ord and chr should be exact inverses of
each other.  chr(ord($c)) should produce the same value as $c.
(Albiet possibly in a different internal encoding.)

I just trawled through my installed modules, looking for existing
uses of ord to support my argument.  Unfortunately for me, my
conclusion is that pretty much any code which uses ord currently
will break in a world with multibyte characters.  I do think that
it would be worthwhile to come up with some examples of intended
uses of ord.  In particular, I'd be very interested in seeing any
cases where you would want it to return the value of a code point
in anything other than the current default encoding.

                     - Damien

Reply via email to