Commit b2f6720
feat: MINICODE_COMMAND_ENCODING override for cp936/GBK command output
On Chinese Windows (cp936 OEM code page), legacy commands (dir, systeminfo,
batch scripts printing CJK) output GBK bytes; the UTF-8 default garbles them,
and a "try UTF-8 then cp936" fallback can't help (GBK bytes are frequently
valid UTF-8, decoding to wrong chars without ever falling back).
Add a MINICODE_COMMAND_ENCODING env override (default utf-8). Setting it to
cp936/gbk decodes such command output correctly. Verified end-to-end (GBK
output decodes to the right CJK chars under cp936). A bad encoding name falls
back to UTF-8 so execution never crashes. Documented in .env.example.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent cbb941f commit b2f6720
3 files changed
Lines changed: 112 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
21 | 56 | | |
22 | 57 | | |
23 | 58 | | |
| |||
338 | 373 | | |
339 | 374 | | |
340 | 375 | | |
341 | | - | |
| 376 | + | |
342 | 377 | | |
343 | 378 | | |
344 | 379 | | |
| |||
359 | 394 | | |
360 | 395 | | |
361 | 396 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | 397 | | |
366 | 398 | | |
367 | 399 | | |
368 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
369 | 406 | | |
370 | 407 | | |
371 | 408 | | |
372 | 409 | | |
373 | | - | |
374 | | - | |
| 410 | + | |
| 411 | + | |
375 | 412 | | |
376 | 413 | | |
377 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments