use JSON; use utf8; my $r = {foo => "Fünf € Lösung"}; binmode STDOUT,':encoding(UTF-8)'; print JSON->new->utf8(0)->encode($r),"\n";