From edeff3cce130203f34d7c0c250e36f871cf28336 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 15 Aug 2026 19:12:14 +1000 Subject: [PATCH] [idd] install: keep captured output in one encoding nsExec merges stdout and stderr into one pipe and detects its encoding once. Emit UTF-16LE on both streams so error output cannot reinterpret progress messages as CJK text. Disable CRT buffering on both streams so progress is visible while service and SetupAPI operations are running. --- idd/LGIddInstall/LGIddInstall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/idd/LGIddInstall/LGIddInstall.c b/idd/LGIddInstall/LGIddInstall.c index b3a5afe9..347b9d6d 100644 --- a/idd/LGIddInstall/LGIddInstall.c +++ b/idd/LGIddInstall/LGIddInstall.c @@ -1149,7 +1149,10 @@ failure: int wmain(int argc, wchar_t **argv) { + _setmode(_fileno(stdout), _O_U16TEXT); _setmode(_fileno(stderr), _O_U16TEXT); + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stderr, NULL, _IONBF, 0); if (argc < 2) usage(argv[0]);