Skip to content

Conversation

@ChrisDryden
Copy link
Collaborator

@ChrisDryden ChrisDryden commented Dec 19, 2025

This PR is to address the lack of locale information when using the -M option in sort since all of the months were hardcoded to the english months. This PR introduces a new dependency icu_datetime to be able to get all of the month locale information.

Originally when trying to fix the associated GNU test it wasn't working because nl was removing non-utf8 characters. Now that the nl issue was addressed this should fix that GNU test.

When implementing this, choices were made that were maybe not the most efficient, but more readable and I think thats the better choice for this type of solution because there will only be a maximum of 12 comparisons when implementing this type of sorting.

@ChrisDryden
Copy link
Collaborator Author

Going to have to wait and rebase until this PR is in: #9720

@sylvestre
Copy link
Contributor

i will have a look once the jobs are green but the approach looks perfect!

@ChrisDryden ChrisDryden force-pushed the sort-locale-month branch 3 times, most recently from f6801e0 to efae246 Compare December 19, 2025 22:09
@ChrisDryden
Copy link
Collaborator Author

Had to revert the string lossy change and add a comment, the string lossy modifies the non utf characters

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@ChrisDryden
Copy link
Collaborator Author

I think another one of the utilities is lossy converting the non utf, investigating now

@ChrisDryden
Copy link
Collaborator Author

Oh the CI is missing the Japan locale

@ChrisDryden ChrisDryden marked this pull request as ready for review December 19, 2025 23:37
@ChrisDryden
Copy link
Collaborator Author

It passed! it was the Japanese locale missing causing the failure

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/sort/sort-month is no longer failing!
Congrats! The gnu test tests/tail/inotify-dir-recreate is now passing!

@RenjiSann
Copy link
Collaborator

Look really good ! Thank you for taking over the month sorting :D

One thing we should be mindful of is the fact that GNU's month sorting exclusively matches month names against the abbreviated month name (see this discussion I had with ICU guys), so it's not bothering with trimming.

Now, this may be a limitation of GNU, and we might not want to stick with it

@ChrisDryden
Copy link
Collaborator Author

Sounds like the ICU data abbreviations don't always match the GNU abbreviations, the one specifically that would fail this is the french april. I don't see how we could do this without the non-exclusive matching

@ChrisDryden
Copy link
Collaborator Author

@RenjiSann is there a different pathway we should take for this then? Was wondering if you had any thoughts on what the next steps should be?

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/sort/sort-month is no longer failing!

@RenjiSann
Copy link
Collaborator

I assumed that would be a known incompatibility, since I can't come with a better solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants