Skip to content

External argv for invalid-UTF-8 word bytes renders as GBK mojibake (was hidden by in-shell recho emulation) #141

Closed

Description

@caomengxuan666

Surfaced by removing the in-executor recho/zecho emulation (99cbc13): when a word containing a lone/non-UTF-8 high byte (e.g. $'ab\xCD') is passed to an EXTERNAL command, the child receives mojibake (顎€-style GBK artifacts) instead of the byte. Valid UTF-8 (€ = e2 82 ac) round-trips byte-faithfully via CreateProcessW.

Windows argv is UTF-16 — raw byte-argv does not exist — but the current encoding path is lossy in the worst way (GBK reinterpretation). Candidate directions (needs owner decision): encode invalid bytes as U+FFFD (canonical lossy), a documented WTF-8 contract, or codepage round-trip where decodable.

Ledger impact: array 8 / nquote4 14 / exp 4 residual lines are this boundary (previously masked by the builtin recho carrying rubash's internal raw-byte markers); audited as platform-boundary in COMPATIBILITY-STATUS alongside NTFS illegal names. Also visible: an ESC (0x1b) byte vanishing in external argv (nquote residual line).

Reproducer: PATH= rubash -c "recho $'ab\xCD'" vs GNU recho output ab<0xCD>.

Activity

  1. added
    bug
    platform
    on Sep 26, 2026
  2. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    已在 0f49ec0 修复并关闭(commit 9656a0e7,三单合一)。GNU 锚点与验收见 issue 评论区。

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

    bugplatform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions