On 2011-01-13 14:11:44 -0500, spir <[email protected]> said:

In Cocoa, string sorting and case-insensitive comparition is also dependent on the user's locale settings, although you can also specify your own locale if the user's locale is not what you want. See kde trying to invent a, hum, "natural", way of sorting file names...)

Mac OS sorts file names in a "natural" way since a very long time (since Mac OS 8 I believe). By natural, I mean that numbers inside the file name are sorted in numeric order while the rest is sorted character by character. For instance "My File 2" will go before "My File 10" in file listings because "2" is less than "10".

There's an option in NSString comparison methods to use this ordering, but it's not the default.


--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to