develooper Front page | perl.perl5.porters | Postings from October 2016

Does the range operator still have the Unicode Bug?

Thread Next
From:
Aristotle Pagaltzis
Date:
October 27, 2016 08:28
Subject:
Does the range operator still have the Unicode Bug?
Message ID:
20161027082828.GA54801@plasmasturm.org
use 5.014;
use Encode 'is_utf8';

my $l = "a";
my $r = chr 255;

sub say_num {
    my $num = () = ($l .. $r);
    say join ' ', is_utf8($l)||0, is_utf8($r)||0, $num;
}

say_num;
utf8::upgrade $l;
say_num;
utf8::upgrade $r;
say_num;
utf8::downgrade $l;
say_num;

__END__
0 0 26
1 0 26
1 1 702
0 1 702

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