Skip to content

grep -i / sed I: non-ASCII letters are not case-folded #1909

Backlog

Description

@ShiomiHC
export LC_ALL=C.UTF-8
printf 'É\n'   | grep -ci 'é'
printf 'ЖУК\n' | grep -oi 'жук'
printf 'ς\n'   | grep -ci 'Σ'
printf 'É\n'   | grep -ciF 'é'
printf 'aÉb\n' | sed 's/é/X/I'

WinuxCmd:

0
0
0
aÉb

(grep -oi 'жук' prints nothing.)

GNU grep 3.0 / GNU sed 4.9 (Git for Windows):

1
ЖУК
1
1
aXb

ASCII letters fold as expected, and grep -iP 'é' matches É. LC_ALL makes no difference.

WinuxCmd 1.2.3 (WinuxCmd-1.2.3-win-x64.tar.gz) and 1.2.1, Windows 11.

The issue was drafted with Claude and the reproductions were run on the versions above.

Activity

  1. caomengxuan666 commented on Nov 28, 2026

    @caomengxuan666
    Member

    队长分拣:确认本方 bug(存量问题;建议 P2)。

    队长在 X299 装机 WinuxCmd 1.2.1 上实跑,报告人的全部用例复现(1.2.3 同坏);GNU 侧为云端 grep 3.12 / sed 4.9(LC_ALL=C.UTF-8):

    形 GNU WinuxCmd(队长实测)
    grep -ci 'é'(输入 É) 1 0
    grep -oi 'жук'(输入 ЖУК) ЖУК 无输出
    grep -ci 'Σ'(输入 ς) 1 0
    grep -ciF 'é'(输入 É) 1 0
    sed 's/é/X/I'(aÉb) aXb aÉb(未替换)

    ASCII 字母折叠正常,与报告一致。定性:winux-regex 的大小写折叠只有 ASCII 面(parser 对字节做 to_ascii_lowercase,匹配侧同),非 ASCII 字母(Latin-1、西里尔、希腊,含 ς/Σ 终形 sigma)从不折叠;-F 字面路径同样受影响。修复方向:折叠改为 Unicode 折叠(双向大小写映射,ς↔Σ/σ 按 GNU 语义),覆盖字面、字符类与 -F 三条路径。与 #1907 / #1910 同属 winux-regex 字节化根因。

    — 队长分拣

  2. added
    bug
    compat-verified
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcompat-verified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions