develooper Front page | perl.perl5.porters | Postings from July 2017

Re: [perl #131685] Rename utf8::is_utf8() (and other functions)

Thread Previous | Thread Next
July 4, 2017 10:11
Re: [perl #131685] Rename utf8::is_utf8() (and other functions)
Message ID:
On 4 July 2017 at 12:04,  <> wrote:
> On Tuesday 04 July 2017 11:22:42 demerphq wrote:
>> No. This is a myth. Plain and simply a myth.
>> People have a hard time accepting it, but the utf8 flag tells parts of
>> the internals to use different rules for certain operations, when set
>> those rules are Unicode. When the flag is not set the default rules
>> are derived from ASCII.
>> You can see the difference in the following:
>> "ba\x{DF}"=~/ss/i;
> $ perl -E 'say "matched" if "ba\x{DF}"=~/ss/i;'
> matched
>> "ba\N{U+DF}"=~/ss/i;
> $ perl -E 'say "matched" if "ba\N{U+DF}"=~/ss/i;'
> matched

-E is not -e.

-E is enabling a pragma which changes the default behavior.

However it is *PRAGMA*. It is NOT the normal behavior of Perl.

>> The latter matches because \N{U+DF} produces the unicode code point
>> DF, and the former does not match, because  \x{DF} produces the ASCII
>> octet DF instead. The former is an ASCII string, and the later is a
>> Unicode string.
> No, both were matched under Perl 5.24.1.

No, they did not. If \x{DF} magically started matching 'ss' it would
be a *MASSIVE* regression.


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About