I am looking to sort the following list which contains names written in different ways:
l=['André','Gerald','Nicole','François','Fraçois','andré']
The expected result is:
['André', 'andré', 'Fraçois', 'François' 'Gerald', 'Nicole']
However, I am could not obtain it. Until now, I have tried to do a double sorting with the sorted command:
l=sorted(sorted(l, key=str.casefold), key=unidecode.unidecode)
But my result is not quite what I am looking for:
['André', 'Fraçois', 'François', 'Gerald', 'Nicole', 'andré']
Do you guys know any other command that could bring me the correct sorting?