Ticket Change Details
Overview

Artifact ID: 4d26ec9f452a96406df0e4c6a5dcaf018ffcc3931df250edb83f3492b9c9f77d
Ticket: 869df60efcf1ed8e8856b6b43fbd29084cf989be
CA files loaded from a VFS fail under a non-Latin-1 locale on Tcl 9 because -encoding binary is no longer valid.
User & Date: bandoti on 2026-11-01 10:36:27
Changes

  1. foundin changed to: "2.0.1"
  2. icomment:
    Tcl 9 removed the "binary" encoding alias, so setting it fails and the channel
    keeps the system encoding. A CA file with non-ASCII bytes then comes back
    corrupted under any system encoding other than iso8859-1. Read it with
    -translation binary, which Tcl 8.6 and 9 both accept, and stop if that fails.
    
    diff -ruN A/generic/tls.c B/generic/tls.c
    --- A/generic/tls.c
    +++ B/generic/tls.c
    @@ -1908,7 +1908,10 @@
         if (in == NULL) {
     	goto cleanup;
         }
    -    Tcl_SetChannelOption(interp, in, "-encoding", "binary");
    +    if (Tcl_SetChannelOption(interp, in, "-translation", "binary") != TCL_OK) {
    +	Tcl_Close(interp, in);
    +	goto cleanup;
    +    }
         buf = Tcl_NewObj();
         Tcl_IncrRefCount(buf);
    
  3. login: "bandoti"
  4. mimetype: "text/plain"
  5. priority changed to: "Medium"
  6. private_contact changed to: "e6a07be3001c236f35faa93e53f095fc289ddb44"
  7. severity changed to: "Important"
  8. status changed to: "Open"
  9. title changed to:
    CA files loaded from a VFS fail under a non-Latin-1 locale on Tcl 9 because -encoding binary is no longer valid.
    
  10. type changed to: "Code Defect"