diff options
| author | Diego Luiz Becker <diegoluizbecker@gmail.com> | 2026-11-29 11:23:16 -0300 |
|---|---|---|
| committer | Diego Luiz Becker <diegoluizbecker@gmail.com> | 2026-11-29 11:23:16 -0300 |
| commit | 48ca87fa24e4e04ea736b0e800f9d71cce631016 (patch) | |
| tree | 3a8c10daf1fe95aeaa0c3ea9a3bbe9a1d30cdebb /runtime/src/xma2_decoder.cpp | |
| parent | 24d89be1739c18cfa655530c874ebe386b98ae97 (diff) | |
make_game: the plain stage logs show a command's output as decoded text, in the caller's encoding (MAKE-GAME-PLAIN-LOG)
PlainStageLogs passed a command's raw bytes to sys.stdout.buffer. A Windows console's buffer takes UTF-8, so
non-ASCII text a command wrote in its own code page showed U+FFFD on screen, where main's --no-tui (the command
inheriting the console) shows it right. Measured in a console with OEM 850 / ANSI 1252: a child writing cp850
"n\xc6o par\x83metro" showed "n\ufffdo par\ufffdmetro".
- run() decodes the output once as it arrives (an incremental decoder, so a character split between two reads
stays whole) and sends that text to the console, encoded for sys.stdout with errors="replace", and to the log;
- the encoding is the one the caller names with run(..., encoding=), else what a text-mode pipe decodes with, as
on the board.
Three new tests: the caller's encoding on the console and in the log, a UTF-8 character split between reads, and
a character the console's code page lacks.
Diffstat (limited to 'runtime/src/xma2_decoder.cpp')
0 files changed, 0 insertions, 0 deletions