Hi bliako,

Are you familiar with Data::Dumper::AutoEncode?


use strict; use warnings; use feature 'say';
use utf8;
use Data::Dumper;
use Data::Dumper::AutoEncode;

my $data = {
    русский  => 'доверяй, но проверяй',
    i中文    => '也許你的生活很有趣',
    Ελληνικά => 'ἓν οἶδα ὅτι οὐδὲν οἶδα',
};

say Dumper $data;
say eDumper $data;

__END__


Output:


$ perl bliako.pl

$VAR1 = {
          "\x{440}\x{443}\x{441}\x{441}\x{43a}\x{438}\x{439}" => "\x{434}\x{43e}\x{432}\x{435}\x{440}\x{44f}\x{439}, \x{43d}\x{43e} \x{43f}\x{440}\x{43e}\x{432}\x{435}\x{440}\x{44f}\x{439}",
          "i\x{4e2d}\x{6587}" => "\x{4e5f}\x{8a31}\x{4f60}\x{7684}\x{751f}\x{6d3b}\x{5f88}\x{6709}\x{8da3}",
          "\x{395}\x{3bb}\x{3bb}\x{3b7}\x{3bd}\x{3b9}\x{3ba}\x{3ac}" => "\x{1f13}\x{3bd} \x{3bf}\x{1f36}\x{3b4}\x{3b1} \x{1f45}\x{3c4}\x{3b9} \x{3bf}\x{1f50}\x{3b4}\x{1f72}\x{3bd} \x{3bf}\x{1f36}\x{3b4}\x{3b1}"
        };

$VAR1 = {
          'русский' => 'доверяй, но проверяй',
          'Ελληνικά' => 'ἓν οἶδα ὅτι οὐδὲν οἶδα',
          'i中文' => '也許你的生活很有趣'
        };


Hope this helps!


The way forward always starts with a minimal test.

In reply to Re: RFC: Perl<->JSON<->YAML<->Dumper : roundtripping and possibly with unicode (Data::Dumper::AutoEncode) by 1nickt
in thread RFC: Perl<->JSON<->YAML<->Dumper : roundtripping and possibly with unicode by bliako

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.