`ls` produce bad output in Windows PowerShell if file name contains non-ASCII characters
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
In a directory with files containing non-ASCII characters in file name:
PS ~\dir> Get-ChildItem | Select-Object Name
Name
----
文件1
fílè₂
файл3
GNU ls through bash gives:
PS ~\dir> bash -c ls
fílè₂ файл3 文件1
While uutils' ls gives lots of escapes (or ? if -N/--literal is used):
PS ~\dir> coreutils.exe -V
coreutils 0.6.0 (multi-call binary)
PS ~\dir> coreutils.exe ls
'f'$'\303\255''l'$'\303\250\342\202\202' ''$'\346\226\207\344\273\266''1'
''$'\321\204\320\260\320\271\320\273''3'
PS ~\dir> coreutils.exe ls -N
f??l????? ????????3 ??????1
Running uu-ls on Linux seems fine:
$ ls
fílè₂ файл3 文件1
$ uu-ls
fílè₂ файл3 文件1
Is it a issue with UTF-8 encoding? It seems that the numbers of ?'s are equal to the character's UTF-8 byte length.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the uu-ls and coreutils.exe ls examples in Windows PowerShell with the listed non-ASCII filenames, then compare them with GNU ls and the Linux behavior. Trace the uu-ls entry point and its Windows output or encoding handling; done means filenames are displayed correctly without escapes or replacement characters, including with -N/--literal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100