On Mon, May 25, 2026 at 07:27:09PM +0100, Gavin Smith wrote:
> I still don't know what is supposed to make two strings sort in a predictable
> order if they differ only by case.  I checked that the sort keys are identical
> in that case.  Patrice, do you remember anything?

The sorting does not only use the sort key, but also the number of the
index entry in index and the index names sort order (needed for merged
indices), as seen in Perl in Indices.pm _sort_index_entries.  Therefore,
the order should be predictable even if the upper and lower case letters
have the same sort key.

That being said, I do not know exactly why the strings are upper-cased
before being sorted.  Maybe this is relevant if there is no
Unicode::Collate sorting (presumably, the lowercase/uppercase sorting is
done well with Unicode::Collate), as it allows the upper-case and lower
case letter to be nearby in sort in that case.

-- 
Pat

  • CI: ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
    • ... Patrice Dumas
      • ... Gavin Smith
        • ... Patrice Dumas
    • ... Gavin Smith
      • ... Gavin Smith
        • ... Patrice Dumas
          • ... Gavin Smith
            • ... Patrice Dumas
              • ... Gavin Smith
        • ... Patrice Dumas

Reply via email to