develooper Front page | perl.perl5.porters | Postings from June 2012

[perl #113584] tr/// multiple transliterations

Thread Previous
From:
Father Chrysostomos via RT
Date:
June 11, 2012 08:33
Subject:
[perl #113584] tr/// multiple transliterations
Message ID:
rt-3.6.HEAD-5009-1339428789-514.113584-15-0@perl.org
On Mon Jun 11 03:43:45 2012, tokuhirom wrote:
> perlop.pod ( http://perldoc.perl.org/perlop.html#Quote-Like-Operators
>    )
> says
> 
> >   If multiple transliterations are given for a character, only the
>    first one is used:
> >
> >       tr/AAA/XYZ/
> >
> >   will transliterate any A to X.
> 
> But I seems perl 5.16.0 is not works on multi-byte characters.
> 
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> TEST CODE
> use strict;
> use warnings;
> use utf8;
> use 5.010000;
> use autodie;
> 
> binmode STDOUT, ':utf8';
> 
> my $x = "Perlα";
> $x =~ tr/αα/βγ/;
> say "$^V $x";
> 
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> RESULT
> 
> The test code runson perl 5.14.2 binary, I got following result.
> 
> v5.14.2 Perlβ
> 
> 
> And I run same script on perl 5.146.0 binary, i got following.
> 
> v5.16.0 Perlγ

A binary search leads me to this:

4de6d205aeab9ec737ca35ba4eb61f37cebefc55 is the first bad commit
commit 4de6d205aeab9ec737ca35ba4eb61f37cebefc55
Author: Karl Williamson <public@khwilliamson.com>
Date:   Mon Jan 2 16:12:21 2012 -0700

    utf8_heavy.pl: Skip unnecessary work for official properties
    
    The tables that mktables generates are well behaved, and so the checks
    and sorting that are done for user-defined properties may be skipped.
    
    tainting needs to be preserved because $list can be passed in already
    tainted.
    
    This is also in preparation for Unicode 6.1, in which one table will
    legitimately have duplicate entries that the old code removed.


-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=113584

Thread Previous


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