Skip to content

ls 中文显示成了转义字符 #1883

Done

Description

@hopenobug

touch "中文"; ls "中文"
''$'\344\270\255'''$'\346\226\207'''

Activity

  1. caomengxuan666 commented on Nov 27, 2026

    @caomengxuan666
    Member

    已复现并定位:交互式 TTY 下 ls 默认使用 shell-escape quoting,而 Windows 环境通常没有 LC_ALL/LC_CTYPE/LANG,原实现因此按 C locale 把中文文件名视为不可打印字节并输出 octal escape。WinuxCmd 的 Windows 文件名/argv 边界实际是 UTF-8,所以未显式设置 POSIX locale 时应保留可打印 Unicode;显式 LC_ALL=C 仍会保持 GNU C locale 的转义行为。

    修复 PR:#1887

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions