At 05:45 PM 3/26/2001 +0000, [EMAIL PROTECTED] wrote:
>Dan Sugalski <[EMAIL PROTECTED]> writes:
> >At 05:09 PM 3/23/2001 -0800, Damien Neil wrote:
> >>So the results of ord are dependent on a global setting for "current
> >>character set" or some such, not on the encoding of the string that
> >>is passed to it?
> >
> >Nope, ord is dependent on the string it gets, as those strings know what
> >their encoding is.
>
>And the code knows what it wants: if I am in an EBCDIC context
>then I am going to expect ord to be ones I am used to.
>This the main pain with 5.7.*'s EBCDIC scheme - making
>
>    ord('A') == 193
>
>true :-/

That would be true if EBCDIC was the default encoding, otherwise false.

If the code cares, it can do a "use encoding qw(Unicode);" to force things.

> > chr is the one dependent on the current default encoding.
>
>You are going to see both used in legacy stuff.

No doubt. Hopefully that'll go away as people are in a position to force 
things the way they want them.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to