http://www.perlmonks.org?node_id=949194


in reply to Re^3: JSON, Data::Dumper and accented chars in utf-8 [OFF/Gripe]
in thread JSON, Data::Dumper and accented chars in utf-8

Thank you both for your replies, although they did not solve my problem.

I kept searching and solved it simply like this:

use Encode; use Encode::Escape; use Data::Dumper; use JSON; ... while ($line = <IN>) { $strut = from_json($line); print decode('unicode-escape', Dumper($strut)) . "\n"; }

This now gives me the output I need, which is the accented chars displayed as they are, since the output is to be redirected to a text file and read by humans on a regular text editor.

Thank you all once again.