Remove accents from a string

I use this shell command:

#!/usr/bin/perl

use warnings;
use strict;
use diagnostics;

use utf8;
binmode(STDOUT, ":utf8");

use Encode ();
use Unicode::Normalize ();

my $s = Encode::decode('UTF-8', $ENV{KMVAR_Name}, 1);
$s = Unicode::Normalize::NFD($s);

$s =~ s/\pM//g;
print $s;

2 Likes