Data-Dumper-Interp

 view release on metacpan or  search on metacpan

lib/Data/Dumper/Interp.pm  view on Meta::CPAN

             $_ }/xegs;

  s/\Q${\_MAGIC_KEEPQUOTES_PFX}\E//gs;
}

sub __unesc_unicode() {  # edits $_
  if (/^"/) {
    # Data::Dumper with Useqq(1) outputs wide characters as hex escapes;
    # turn them back into the original characters if "printable".
    # That means "Graph" category EXCEPT:
    #   BOM (which is ZERO WIDTH NO-BREAK SPACE so is considered "Graphical")
    #   and any other "Format" category Unicode characters; we want see those
    #   in hex.
    s{
       \G (?: [^\\]++ | \\[^x] )*+ \K (?<w> \\x\x{7B} (?<hex>[a-fA-F0-9]+) \x{7D} )
     }{
       my $orig = $+{w};
       local $_ = hex( length($+{hex}) > 6 ? '0' : $+{hex} );
       $_ = $_ > 0x10FFFF ? "\0" : chr($_); # 10FFFF is Unicode limit
       # Using 'lc' so regression tests do not depend on Data::Dumper's
       # choice of case when escaping wide characters.



( run in 0.595 second using v1.01-cache-2.11-cpan-e9daa2b36ef )