Home > Software design >  What locale/rule gives this string sort order?
What locale/rule gives this string sort order?

Time:12-31

I have subscribed to a cloud drive service. All good until I needed to check that all folders in a long list had been actually uploaded. I realized that the name-based sort order in my local system is different than the one used by the remote cloud service or its web interface whatsoever. So I tried to figure out what is the remote sort order, in order to then use it also locally (before, I had tried to find configurations for the remote system to no avail). I am totally lost. So the question is:

What rules/locale sorts the following strings in this exact order?

T. J. Smith

T. Smith

T.J. Smith

Talya

T'Amya

Tamya

(I put Talya in there so to show that the sort order is "ascending" because in any (reasonable) sort order Talya comes before Tamya)

I have tried different ways to sort the list of strings in the hopes that one would match the cloud service's own order. This is what I tried

In Windows 10 (with my locale!) this list is sorted as:

enter image description here

In my Ubuntu Nautilus I get this:

enter image description here

And, finally, if I put those strings in a file (sortme.txt) and call "sort" from command line in Ubuntu I get the following:

(first LC_COLLATE=C)

enter image description here

(second, LC_COLLATE=en_US.UTF-8)

enter image description here

As you see no one of these match the desired ordering in particular no one matches the order of the strings "Talya", "T'Amya", "Tamya"

I would be very thankful if anybody could help me sort this out :-)

CodePudding user response:

Not sure whether I should delete this question altogether. I realized that the sorting algorithm that I was trying to understand is just severely bugged: it has an outright wrong behavior where it puts half of al list in increasing order and the other half in decreasing order. So this order is probably just the result of a bug.

Anyway I resorted to use the cloud storage from another OS, with another interface, that just works as expected.

  • Related