Skip to content

ls: add better support for non-UTF-8 bytes #7020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

jtracey
Copy link
Contributor

@jtracey jtracey commented Dec 29, 2024

The second commit also enables the tests added here and #6993 on the two linux-gnu targets (I confirmed they pass on Android too, and they should work in MacOS, but GNU is the least likely environment to add anything that would be unhappy with these names).

There's two FIXMEs added, I'll file issues for them after merging:

  • None of the available major globbing libraries, which we need for specifying ignore patterns, support anything other than &str. The comment lists three relevant issues (one, two, three), any one of which would be good enough for our purposes, but I suspect we'll be waiting a while before we see a fix. In the meantime, we match the best we can using lossy conversions; hopefully such sequences are rare in ignore patterns.
  • The imported Grid type for displaying aligned names also only takes &str. We already use a custom fork, and I suspect we could change the types in a fairly unobtrusive way, so this might be an easy fix. This is rarely observable as a bug though, outside of displaying raw bytes to the terminal (which is an unlikely combination of circumstances).

Linux + GNU is the OS + userspace least likely to run into issues with such
names, both now and in the future.
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@sylvestre sylvestre merged commit 6a8b766 into uutils:main Jan 2, 2025
62 of 63 checks passed
@sylvestre
Copy link
Contributor

Thanks!

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.

2 participants