use strict; use warnings; use Encode 'decode'; use Test::More tests=>1; my $in_file = qq(This isn\xe2\x80\x99t hard); my $text = decode('utf-8', $in_file); $text =~ tr/\N{RIGHT SINGLE QUOTATION MARK}/\N{APOSTROPHE}/; is( $text, q(This isn't hard), 'quote mark test' );