~# perl --version
This is perl 5, version 14, subversion 2 (v5.14.2)
...
~# locale
LANG=en_US.utf8
...
####
#! /usr/bin/perl -w
use 5.014;
use feature 'unicode_strings';
use strict;
use warnings;
my $string = "\x{c3}\x{a9}";
print length($string)."\n";
print "$string\n";
------------------
~# ./test.pl
2
é
####
#! /usr/bin/perl -w
use 5.014;
use feature 'unicode_strings';
use strict;
use warnings;
use utf8
my $string = "é";
print length($string)."\n";
print "$string\n";
------------------
~# ./test.pl
1
?
####
#! /usr/bin/perl -w
use 5.014;
use feature 'unicode_strings';
use strict;
use warnings;
open(HDL,"./test.txt");
my $string = ;
chomp($string);
print length($string)."\n";
print "$string\n";
------------------
~# cat test.txt
é
~# ./test.pl
2
é
####
#! /usr/bin/perl -w
use 5.014;
use feature 'unicode_strings';
use strict;
use warnings;
use Unicode::Normalize;
my $string = "\x{c3}\x{a9}";
my $decomposed = NFD( $string );
$decomposed =~ s/\pM//g;
$decomposed = NFC( $decomposed );
print length($decomposed)."\n";
print "$decomposed\n";
------------------
~# ./test.pl
2
A?
####
#! /usr/bin/perl -w
use 5.014;
use feature 'unicode_strings';
use strict;
use warnings;
use Text::Unidecode;
my $string = "\x{c3}\x{a9}";
my $ascii = unidecode($string);
print length($ascii)."\n";
print "$ascii\n";
------------------
~# ./test.pl
4
A(c)