Debian's American Sorting
I was writing a little example of a GTK treeview for my scripts repository
when I noticed something rather funny about Debian's dictionaries.
My example uses /usr/share/dict/words as a handy source of data, just A through C since it turns out the TreeStore is rather slow in adding data. I expected top-level items of A, B, and C. What I got instead was: A, B, C, É, C, É, C, É, C.
What I got when I expanded the categories was even weirder: a bunch of éclairs mixed in with all my C words.
Was there something weird about my script? It didn't seem likely: I wasn't doing any sorting, just reading lines one by one from the file.
Sure enough, looking at /usr/share/dict/words confirmed what I was seeing:
laims Clair éclair Claire Claire's Clairol Clairol's Clair's éclair's éclairs clairvoyance clairvoyance's clairvoyantand several similar sections later on.
Apparently, whatever is generating this /usr/share/dict/words for Debian
has a bug in its sorting where it ignores any accented character and sorts
based on just the remaining ASCII characters, with the accented characters
left out.
On my system, /usr/share/dict/words is a symbolic link to /etc/dictionaries-common/words, which symlinks to /usr/share/dict/american-english, which comes from the package "wamerican".
Was it even supposed to be sorted? I checked the relevant man page: american-english(5) says:
/usr/share/dict/american-english is an ASCII file which contains an alphabetic list of words, one per line.
That's wrong in two ways. First, it's not sorted, but second, it's not ASCII, since it contains accented characters like é.
I filed a
Debian bug on the wenglish package.
[ 11:44 Sep 13, 2026 More linux | permalink to this entry | ]