use strict; use warnings; use utf8; use JSON; my $data = "text – abcd"; binmode STDOUT, ":utf8"; print "$data";