Remove accents from a string

Hi :wave: I want to replace for example

Collège Jacques Grüber

into

COLLEGE JACQUES GRUBER

Which means Capitalize (that I found already :joy:) and remove the accents for any kind of accent in french é è ë ê à ù ç is there an easy way or do I have to search and replace for every kind of accent possible ?

Thanks for your help :blush:

In JavaScript:

.normalize("NFD")
.replace(/\p{Diacritic}/gu, "")
.toLocaleUpperCase()

so, for example:

Without diacritics.kmmacros (2.6 KB)

4 Likes

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

Thx a lot guys :pray: :pray: :pray: - I tried ComplexPoint macro and it works perfectly !!!

Problem's solved for me :sweat_smile: its great :sunglasses:

3 Likes