Rockbox mail archiveSubject: Re: how is strnatcmp aka "Interpret numbers while sorting" supposed to sort?
Re: how is strnatcmp aka "Interpret numbers while sorting" supposed to sort?
From: Thomas Martitz <thomas.martitz_at_fhtw-berlin.de>
Date: Thu, 19 Mar 2009 15:02:17 +0100
Mike Holden wrote:
> Maybe leading zeros should only be stripped if another digit follows them?
> I use names like 00RockFaves.m3u, 00ClassicRock.m3u for playlists that I
> have created (as opposed to original artist albums), and the leading
> zerozero is deliberately there to sort them at the top.
> At the moment using natural sorting, 00RockFaves.m3u is sorted among the
> "R" entries, totally defeating my intention in choosing that naming (and
> not "natural" to my view!).
> 01Rock should sort before 02Rock, agreed, but should 01Rock sort before A
> or before S?
Sounds to me that you're better off using ascii sort.
>> In any case, it would be interesting to see how windows does the
>> sorting, as the most users will be used to that way of doing it.
> Maybe many, but we shouldn't assume that is the case. I personally have no
> idea how Windows does it, and I wouldn't necessarily agree that just
> because MS does it that that is the _right_ way to do it.
Windows does it in the same way as nautilus and other major file
browsers. It ignores leading zeros.
Received on 2009-03-19