Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b9be1eaabce8645208e296335cff41410258598401f4acaf97042149d2ad93ec
Ticket: 85ddd247b637bcb25990fc55536e0ce3f9e754b2
Unable to set channel to binary encoding
User & Date: cjmcdonald on 2024-06-19 16:56:40
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    Tcl 9.0b2
    
    Windows 10 22H2
    
    Default build of Tcl 9.0b2:
    
    <pre>
        nmake -f makefile.vc INSTALLDIR=C:\Tcl9
        nmake -f makefile.vc INSTALLDIR=C:\Tcl9 install
    </pre>
    
    Trying to change a file channel to binary, it gets set to iso8859-1:
    
    <pre>
    C:\Tcl9\bin\tclsh90.exe
    % encoding system
    utf-8
    % set f [open temp.txt w]
    file268360e3060
    % fconfigure $f
    -blocking 1 -buffering full -buffersize 4096 -encoding utf-8 -eofchar {} -profile strict -translation crlf
    % fconfigure $f -encoding binary
    % fconfigure $f -encoding
    iso8859-1
    % close $f
    %
    % set f [open temp.txt wb]
    file268360e3060
    % fconfigure $f -encoding
    iso8859-1
    % close $f
    %
    </pre>
    
    I encountered the same issue with a tcludp channel in Tcl 9.0b2.
    
    A possibly related issue occurs running the same build on a Windows Server 2019 system.  It now incorrectly reports the system encoding as iso8859-1.
    
    <pre>
    C:\Tcl9\bin\tclsh90.exe
    % encoding system
    iso8859-1
    </pre>
    
    With Tcl 8.* it was correctly reported as cp1252.  I'd guess that Windows Server 2019 may not support the `<activeCodePage>` UTF-8 setting which has been added to the tclsh manifest.
    
  5. foundin changed to: "9.0b2"
  6. is_private changed to: "0"
  7. login: "cjmcdonald"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "15d05e35c6efd35720375a1ce4b01373f7d13297"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "cjmcdonald"
  14. subsystem changed to: "25. Channel System"
  15. title changed to: "Unable to set channel to binary encoding"
  16. type changed to: "Bug"