Supprimer les accents

@joekakone

Joseph Konka @joekakone

03/03/2022 · 3 min

Pyinstaller est un package Python qui permet de convertir des scripts Python en executable .EXE. Ce tutoriel .

#! /usr/bin/env python3
# coding : utf-8


import unicodedata


def clean(string):
    y = unicodedata.normalize('NFKD', chaine).encode('ASCII', 'ignore')
    return y.decode("utf-8")


chaine = u"mà chàîne âvèc dès càräctère spéciâüx"
cleaned_chaine = clean(chaine)
print(type(cleaned_chaine))
print(cleaned_chaine)

.

Commentaires

Inscrivez-vous à une formation complète

Voir le catalogue