This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #130656] tr// failue with UTF-8 across lines
authorKarl Williamson <khw@cpan.org>
Tue, 31 Jan 2017 18:15:08 +0000 (11:15 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 31 Jan 2017 18:30:15 +0000 (11:30 -0700)
commitfe2ba0a2de216bca4582bfb493b196d2eb4c94ae
tree0f1e0f16b4191f5108a8e5c921ebaae9f54ad574
parentcbf40e71df30fba4761230a8b62a34d7bb247495
PATCH: [perl #130656] tr// failue with UTF-8 across lines

This bug happend under things like

tr/\x{101}-\x{200}/
   \x{201}-\x{301}/

The newline in the middle was crucial.  As a result the second line got
parsed already knowing that the result was UTF-8, and as a result
setting a variable got skipped which happens only when we discover we
need to flip into UTF-8.

The solution adopted here is to set the variable under other conditions,
which leads to it getting set multiple times.  But this extra branch and
setting is confined to somehwat rare circumstances, leaving the mainline
code untouched.
t/op/tr.t
toke.c