in reply to Re^2: Malformed UTF-8 character (unexpected continuation byte 0x96, with no preceding start byte)
in thread Malformed UTF-8 character

It seems to work for me:
$ perl -E 'use utf8; my $data = "text - abcd"; say "$data";' text - abcd $ $ perl -E 'use utf8; my $data = "text – abcd"; print "$data";' Wide character in print at -e line 1. text – abcd $ $ perl -E 'use utf8; my $data = "text – abcd"; binmode STDOUT, ":utf8 +"; say "$data";' text – abcd
It might be hard to see the difference on the screen, but I zoomed on the output and I can confirm that I have really printed two different species of dash.
  • Comment on Re^3: Malformed UTF-8 character (unexpected continuation byte 0x96, with no preceding start byte)
  • Download Code