diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-06 00:05:36 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-06 00:05:36 -0700 |
commit | cb8157e3a5ec3b59831734fb1297034748146613 (patch) | |
tree | 30bf83ff2b5678b4b5da71e9a889cbd88ec42d19 /dist/B-Deparse | |
parent | e7afc405f7bafc8c3d0f1e53094a94c24adaad3e (diff) | |
download | perl-cb8157e3a5ec3b59831734fb1297034748146613.tar.gz |
Make Deparse work with y/å/ø/
Diffstat (limited to 'dist/B-Deparse')
-rw-r--r-- | dist/B-Deparse/Deparse.pm | 6 | ||||
-rw-r--r-- | dist/B-Deparse/t/deparse.t | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index bec809ef8f..ba5fd01fda 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -4087,8 +4087,12 @@ sub pp_trans { my $self = shift; my($op, $cx) = @_; my($from, $to); - if (class($op) eq "PVOP") { + my $class = class($op); + if ($class eq "PVOP") { ($from, $to) = tr_decode_byte($op->pv, $op->private); + } elsif ($class eq "PADOP") { + ($from, $to) + = tr_decode_utf8($self->padval($op->padix)->RV, $op->private); } else { # class($op) eq "SVOP" ($from, $to) = tr_decode_utf8($op->sv->RV, $op->private); } diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index b9c2bf4395..570f64efb3 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -17,7 +17,7 @@ BEGIN { require feature; feature->import(':5.10'); } -use Test::More tests => 93; +use Test::More tests => 94; use Config (); use B::Deparse; @@ -675,3 +675,6 @@ foreach $' (1, 2) { #### # y///r tr/a/b/r; +#### +# y/uni/code/ +tr/\x{345}/\x{370}/; |