Tech News
← Back to articles

When I say “alphabetical order”, I mean “alphabetical order”

read original related products more articles

When I say “alphabetical order”, I mean “alphabetical order”

Last month I have been on a multi-day hike with my dad. Each of us took many pictures, and when we came back we put them all in a shared folder. We both have Android phones, and the naming scheme used for our pictures was the same: IMG_YYYYMMDD_HHmmss followed maybe by some other numbers and then a .jpg . Here YYYY stands for the year, MM for month and so on, so that sorting the pictures in alphabetical order is the same as sorting them by date.

Or so I thought. Strangely, when I looked at the files from my dad’s Windows PC, they were not sorted correctly: all the pictures took with my phone came first, followed by all the pictures took by him. I thought this was surely some weird Microsoft bug - after using Windows 11 at work for a while, I would not be surprised if you told me their file explorer can’t figure out how to sort strings.

But then I looked at the same files in a shared Google Drive folder, and again they were in the wrong order:

As you can see, the picture taken at 5:54 (with my dad’s phone) comes before the one taken at 9:20 (also with my dad’s phone), but after the one taken at 12:11 (with my phone).

Weird. Well, maybe Microsoft and Google got this wrong. But that seems unlikely.

Indeed, KDE’s Dolphin file manager does the same thing:

I’ll spare you the screenshots, but Gnome and both the file managers that I have on my phone also get the alphabetical order wrong.

At this point I thought that maybe one of the two phones is using some weird alternative unicode character instead of the underscore _ . Really, I could not see any other explanation. But nope, this is not it, because the good old ls sorts my files correctly:

$ ls -l total 218572 -rw-r--r-- 1 seba seba 1866185 Aug 28 18:51 IMG_20250820_055436307.jpg -rw-r--r-- 1 seba seba 4749899 Aug 28 18:50 IMG_20250820_092016029_HDR.jpg -rw-r--r-- 1 seba seba 6201609 Aug 28 18:52 IMG_20250820_092440966_HDR.jpg -rw-r--r-- 1 seba seba 7694802 Aug 28 18:51 IMG_20250820_092832138_HDR.jpg -rw-r--r-- 1 seba seba 1536520 Aug 20 09:57 IMG_20250820_095716_607.jpg -rw-r--r-- 1 seba seba 1054553 Aug 20 10:38 IMG_20250820_103857_991.jpg -rw-r--r-- 1 seba seba 965353 Aug 20 10:39 IMG_20250820_103903_811.jpg (and so on)

... continue reading