GUI installer stops before final message on Japanese Windows (encoding issue)

Yukimasa Morimi via tex-live <[email protected]>
Newsgroups gmane.comp.tex.live
Message-ID <[email protected]>
Dear TeX Live developers,

I installed the TeX Live 2026 pretest using the GUI installer on a Japanese 
Windows 11 24H2 system.

The installer stopped without displaying the final "Welcome" message. 
However, the "Welcome" message appears in install-tl.log, indicating that 
the installation itself completed successfully.

I recalled that several Japanese users reported a similar issue last fall. 
After repeating the installation multiple times, I confirmed that the 
problem is reproducible.

Further investigation suggests that this is an encoding-related issue. The 
output from the Perl subprocess running the installation script is encoded 
in the system ANSI code page (ACP), which is cp932 on Japanese Windows. 
However, Tcl attempts to decode this output as UTF-8 and stops reading it 
when a decoding error occurs. The tclkit.exe included in the installer 
contains an embedded manifest with <activeCodePage>UTF-8</activeCodePage>, 
which appears to override the system settings and causes Tcl to assume 
that the ACP is UTF-8.

I was able to resolve the issue by retrieving the actual ACP from the 
registry and explicitly specifying the encoding, as shown in the attached 
patch. I hope that this change does not introduce any issues for 
non-Japanese languages or non-Windows platforms.

Best regards,
Yukimasa Morimi
install-tl-gui-encoding.Patch (application/octet-stream, 2.4 KB)
--- C:/Users/ymori/AppData/Local/Temp/install-tl-gui.tcl-revBASE.svn000.tmp.tcl	“y 1  4 23:31:54 2025
+++ D:/texlive-svn/Master/tlpkg/installer/install-tl-gui.tcl	‰Î 2 10 17:42:46 2026
@@ -205,12 +205,22 @@ proc read_line_loading {} {
 # ::out_log should no longer be needed
 proc read_line_cb {} {
   set l "" ; # will contain the line to be read
-  if {([catch {chan gets $::inst l} len] || [chan eof $::inst])} {
+  if {[catch {chan gets $::inst l} len]} {
+    .log.tx configure -state normal
+    .log.tx insert end "DEBUG: read_line_cb: catch: $len\n"
+    .log.tx yview moveto 1
+
     catch {chan close $::inst}
     # note. the normal way to terminate is terminating the GUI shell.
     # This closes stdin of the child
     .close state !disabled
     if [winfo exists .abort] {.abort state disabled}
+  } elseif {[chan eof $::inst]} {
+    catch {chan close $::inst}
+    # note. the normal way to terminate is terminating the GUI shell.
+    # This closes stdin of the child
+    .close state !disabled
+    if [winfo exists .abort] {.abort state disabled}
   } elseif {$len >= 0} {
     # regular output
     .log.tx configure -state normal
@@ -1940,7 +1950,27 @@ proc run_installer {} {
   # the backend was already running and needs no further encouragement
 
   # switch to non-blocking i/o
-  chan configure $::inst -buffering line -blocking 0
+  if {$::tcl_platform(platform) eq "windows"} {
+    package require registry
+    set system_enc [encoding system]
+
+    # When the Tcl manifest specifies 'activeCodePage' as UTF-8, [encoding system]
+    # returns 'utf-8'. However, external processes often still output in the 
+    # system's original ANSI code page (e.g., CP932 for Japanese).
+    # We query the registry to get the 'true' system ANSI code page (ACP) 
+    # to correctly decode piped output from these external tools.
+    set regPath "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage"
+    if {![catch {registry get $regPath "ACP"} acp_num]} {
+      if {$acp_num eq "65001"} {
+        set system_enc "utf-8"
+      } elseif {"cp$acp_num" in [encoding names]} {
+        set system_enc "cp$acp_num"
+      }
+    }
+    chan configure $::inst -encoding $system_enc -profile replace -translation auto -buffering line -blocking 0
+  } else {
+    chan configure $::inst -buffering line -blocking 0
+  }
   chan event $::inst readable read_line_cb
   raise .
   if {$::tcl_platform(platform) eq "windows"} {wm deiconify .}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.