->ascii will restrict the output to US-ASCII characters.
->ascii
my $json = JSON::XS->new->ascii;my $text = $json->encode($hash);
use JSON::XS ();use JSON; # uses JSON::XS by default (if available)$json_text = to_json( { text => 'Dragón' }, { 'ascii' => 1 } );