in reply to Re^2: malformed UTF-8 character in JSON string in perl
in thread malformed UTF-8 character in JSON string in perl
This is the same example with first one regular dash and then an "irregular" one, using first Data Dumper to show the UTF-8 escape sequence on the irregular dash, and showing what I get with binmode:
If this does not work for you and it does for me, I would suspect that either your version of Perl is too old (I am using 5.14) or that there is something wrong in your terminal configuration.$ perl -e ' use strict; use warnings; use utf8; use Data::Dumper; my $data = "regular dash - other type of beast: – abcd"; print Dumper $data; binmode STDOUT, ":utf8"; print "$data"; ' $VAR1 = "regular dash - other type of beast: \x{2013} abcd"; regular dash - other type of beast: – abcd
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: malformed UTF-8 character in JSON string in perl
by Yllar (Novice) on Aug 11, 2015 at 16:00 UTC |