From bd21571061a31f4d4fc09556811b26dc111d3bc7 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 13 May 2021 08:28:48 +0000 Subject: [PATCH] For 5.34.0, revert the fix for GH #18614 as it introduces a regression. This reverts the XS code change from March 2021 from commit c71f1f234aad8a3c: Make Data::Dumper mark regex output as UTF-8 if needed retains the new tests, but skips them for Dumpxs. The change fixed one bug, but introduced another (GH #18764). The fix for both seems a little too risky this late in the release cycle, so revert to the v5.32.0 behaviour for the v5.34.0 release itself. Both bugs will be fix with a CPAN release very soon, which likely will also be in v5.34.1 --- dist/Data-Dumper/Dumper.pm | 4 ++-- dist/Data-Dumper/Dumper.xs | 4 ---- dist/Data-Dumper/t/dumper.t | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm index e3dc0ff79f93..267cb92aae9d 100644 --- a/dist/Data-Dumper/Dumper.pm +++ b/dist/Data-Dumper/Dumper.pm @@ -29,7 +29,7 @@ our ( $Indent, $Trailingcomma, $Purity, $Pad, $Varname, $Useqq, $Terse, $Freezer our ( @ISA, @EXPORT, @EXPORT_OK, $VERSION ); BEGIN { - $VERSION = '2.178'; # Don't forget to set version and release + $VERSION = '2.179'; # Don't forget to set version and release # date in POD below! @ISA = qw(Exporter); @@ -1476,7 +1476,7 @@ modify it under the same terms as Perl itself. =head1 VERSION -Version 2.178 +Version 2.179 =head1 SEE ALSO diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs index e19997440a76..6aca9182b67f 100644 --- a/dist/Data-Dumper/Dumper.xs +++ b/dist/Data-Dumper/Dumper.xs @@ -651,10 +651,6 @@ dump_regexp(pTHX_ SV *retval, SV *val) assert(sv_pattern); - if (SvUTF8(sv_pattern)) { - sv_utf8_upgrade(retval); - } - rval = SvPV(sv_pattern, rlen); rend = rval+rlen; slash = rval; diff --git a/dist/Data-Dumper/t/dumper.t b/dist/Data-Dumper/t/dumper.t index fd5e7eb3157e..aa5785920cd3 100644 --- a/dist/Data-Dumper/t/dumper.t +++ b/dist/Data-Dumper/t/dumper.t @@ -1725,6 +1725,9 @@ EOW TEST qq(Data::Dumper->Dump([ [qq/\x{41f}/, qr/\x{8b80}/, qr/\x{41f}/] ])), "string with Unicode + regexp with Unicode"; + SKIP_TEST "skipped, pending fix for github #18764"; + last; + TEST qq(Data::Dumper->Dumpxs([ [qq/\x{41f}/, qr/\x{8b80}/, qr/\x{41f}/] ])), "string with Unicode + regexp with Unicode, XS" if $XS;