Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Convert JSON to Perl and back with unicode

by choroba (Cardinal)
on Apr 11, 2020 at 00:00 UTC ( [id://11115353]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #! /usr/bin/perl
    use warnings;
    use strict;
    ...
    binmode STDERR, ':encoding(UTF-8)';
    print STDERR Dumper(\%mydatatoshow);
    print STDERR Dumper(\%mydatatoshow) =~ s/\\x\{([0-9a-f]{2,})\}/chr(hex
    +($1))/ger;
    
  2. or download this
    s/((\\+)x\{([0-9a-f]{2,})\})/
        (length($2) % 2) ? substr($2, 1) . chr hex $3 : $1/ger;
    
  3. or download this
    #! /usr/bin/perl
    use warnings;
    ...
    
    eval $dumper_choroba;
    is_deeply $VAR1, \%datatoshow;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11115353]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-19 18:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found