From cb8157e3a5ec3b59831734fb1297034748146613 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 6 Nov 2010 00:05:36 -0700 Subject: [PATCH] =?utf8?q?Make=20Deparse=20work=20with=20y/=C3=A5/=C3=B8/?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- dist/B-Deparse/Deparse.pm | 6 +++++- 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 bec809e..ba5fd01 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 b9c2bf4..570f64e 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}/; -- 2.7.4