Here's a bare bones scenario:
I start ipython3 from a shell prompt like so:
% LANG='fr_FR.UTF-8' ipython3
I confirm in ipython that the locale has changed from my default en_US.UTF-8 locale to the French equivalent.
print(locale.getlocale())
('fr_FR', 'UTF-8')`
I create the following dictionary:
dict = {'O':'3', 'É':'2', 'Œ':'4', 'E':'1', 'Z':'5'}
I proceed to print the entries of dict sorted by key value:
for k, v in sorted(dict.items()):
... print(k, v)
And this is the output:
E 1 O 3 Z 5 É 2 Œ 4
If I understand the French collating rules this should have been:
E 1 É 2 O 3 Œ 4 Z 5
In other words a student of the French language would expect to find the word Œuf (egg) somewhere between Odeur and Offense when looking it up in a dictionary… not pushed out of the way after all the words that happen to start with ASCII letters A-Z. Same with words that contains such letters as 'é','ê', 'è', 'ô' to name a few.
I this to be expected… and if so how would I work around this difficulty?