I am trying to sort a list of strings using the sorted() function. The problem is that I am using (french) accent. I have tried:
import locale
import functools
locale.setlocale(locale.LC_ALL, 'fr_FR')
test=('pêche','pomme')
sortedtest=sorted(test,key=functools.cmp_to_key(locale.strcoll))
But it doesn't work (returns 'pomme, pêche' instead of 'pêche, pomme'). Could anyone help me?