develooper Front page | perl.perl5.porters | Postings from January 2001

Re: more UTF8 test suites and an UTF8 patch

Thread Previous | Thread Next
From:
nick
Date:
January 4, 2001 13:43
Subject:
Re: more UTF8 test suites and an UTF8 patch
Message ID:
E14EI7r-0005YB-00@roam1
Simon Cozens <simon@cozens.net> writes:
>On Sat, Dec 30, 2000 at 12:14:44AM -0600, Jarkko Hietaniemi wrote:
>[unicode::distinct]
>> >   Now any string which is SvUTF_off is equal to another string which
>> >   is SvUTF_on. `eq' can't distingush them.  

I don't see why eq should be able to tell them apart. If you want to 
stare into the guts you should _need_ to use Encode::is_utf8 or some 
other scalpel. 

>> >This pragma forces all
>> >   SvUTF_on string differ to any SvUTF_off string.
>> 
>> Ummmm.  Introducing new pragmas should be considered carefully.
>> Can you give an example of how to use this pragma?  What problem
>> does it solve?
>
>Just one second! What's the difference between:
>
>    $a = v50.400; chop $a;
>    $b = chr(50);
>    
>    print "Two chr(50)s are the same, no suprise" if $a eq $b
>
>    {
>        use unicode::distinct;
>        print "Shouldn't be the same now" if $a eq $b;
>    }

And how exactly are they not the same ? - the fact that UTF8 flag is on on one?
Who says that chop may not downgrade? Who says that chr(50) may not upgrade
on comparison on EBCDIC machine?

And what about (the more problematic case):

    $a = v128.400; chop $a;
    $b = chr(128);

>
>and
>
>    {
>        use bytes;
>        print "Shouldn't be the same now" if $a eq $b;
>    }

bytes will show them equal for chr(50) 'cos it does not change under UTF-8
encoding.

>
>Seems to me the whole idea is what the bytes pragma is for.



-- 
Nick Ing-Simmons


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About