You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] ANSI-C \u/\U escapes decoded regardless of locale: under LC_ALL=C GNU keeps the literal backslash-u text (uppercased hex), rubash emits UTF-8 bytes #353
GNU 5.3.0 under LC_ALL=C: prints the 6 literal characters \u00E9 (hex UPPERCASED — the escape is left unexpanded when the locale cannot represent it).
rubash: prints the UTF-8 bytes of é (0xC3 0xA9) — \u decoding ignores locale.
Distinct from #323 (that one is $'…' not decoded in the ${var//pat/repl} replacement operand — an expansion-position bug; this is the locale gate on the decoder itself).
GNU C owner: lib/sh/strtrans.c:51 ansicstr() — the \u/\U branch checks the locale (locale_mb_curmax / utf8 locale) before emitting the encoded character; non-UTF-8 locales keep the literal text.
Artifacts: target/issue-suites/results/gnusweep3/cat1/case/q013.* / q014.; minimal target/issue-suites/results/gnusweep3/probes/min/m21-ansi-u-locale.
Fixed by wt21/resid21 (495082eb, master d5d6642): landed the GNU read-time semantics rather than full deferred decode (which would touch every observable boundary — typed-carrier-class risk). GNU reads dollar-single-quote lists line by line and decodes each at READ time (parse.y:5560 ansiexpand), so export LC_ALL=C on a PREVIOUS line takes effect, while the same list/brace group/earlier-defined function body keeps the original locale — L1-L4c probes all byte-identical to WSL GNU. Implementation: thread-local decode-locale override; lexer value dispatch extracted verbatim to word_value_from_raw; WordMetadata records the lex-time locale (only words containing backslash-u escapes); executor records the per-line read-time locale; command words and assignment RHS (including the pure-assignment path that bypasses expand_command_words) re-derive under the line locale when they differ. nquote1-5/iquote/intl/new-exp/unicode byte-identical baseline vs fixed. Documented residual: for-in and case words still lex-time locale (rare family, untested-by-corpus).
Activity
gnusweep3: GNU-syntax deep-water wave 3 — orphan-sub harvest + 8 cons…
fix(#351,#353,#356): heredoc delimiter quote, locale u-escape gate, n…
caomengxuan666 commentedon Sep 30, 2026
Fixed by wt21/resid21 (495082eb, master d5d6642): landed the GNU read-time semantics rather than full deferred decode (which would touch every observable boundary — typed-carrier-class risk). GNU reads dollar-single-quote lists line by line and decodes each at READ time (parse.y:5560 ansiexpand), so export LC_ALL=C on a PREVIOUS line takes effect, while the same list/brace group/earlier-defined function body keeps the original locale — L1-L4c probes all byte-identical to WSL GNU. Implementation: thread-local decode-locale override; lexer value dispatch extracted verbatim to word_value_from_raw; WordMetadata records the lex-time locale (only words containing backslash-u escapes); executor records the per-line read-time locale; command words and assignment RHS (including the pure-assignment path that bypasses expand_command_words) re-derive under the line locale when they differ. nquote1-5/iquote/intl/new-exp/unicode byte-identical baseline vs fixed. Documented residual: for-in and case words still lex-time locale (rare family, untested-by-corpus).