Yllar has asked for the wisdom of the Perl Monks concerning the following question:
use utf8; use Encode qw(encode_utf8); use JSON; use Data::Dumper; my $data = qq( { "cat" : "text – abcd" } ); my $json_data = encode_utf8( $data ); my $perl_hash = decode_json( $json_data ); print Dumper($perl_hash);
I am getting following error when executing the code.
$VAR1 = { 'cat' => "text \x{2013} abcd" };
I need the output like "text – abcd". Is thr any module other than(Text::Unidecode), or a method of converting these characters like ',",-,.,? to simple ASCII characters?
Any help from you guys would be appreciated greatly.
|
---|