Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9fb3bbfb337af15112cf976e9c5d909f5fb303a039f1bb213b069b063ac723a7
Ticket: a008bc0a7e785fa7c93e621121c4b838ca23b0de
Documentation of "encoding system" may be enhanced.
User & Date: oehhar on 2024-07-01 12:25:23
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    The current documentation of "encoding system" is:
    
    <verbatim>
    encoding system ?encoding?
    Set the system encoding to encoding.
    If encoding is omitted then the command returns the current system encoding.
    The system encoding is used whenever Tcl passes strings to system calls. 
    </verbatim>
    
    IMHO, the information, that the system encoding is used for system calls is only partly correct.
    The usage is platform dependent. More and more system API migrate to a fix encoding. On the Windows side, the CESU16 encoding is used for all most calls independent on this setting.
    
    The default encoding has the following consequences:
    
       *   it is the default encoding for files and sockets, if no encoding is specified
       *   it is the default encoding for the encoding convertfrom/convertto commands
       *   it may be used for system resources like file names, pipe data, environment variables and command line arguments. This is platform dependend and unclear to the author.
    
    Another point not documented jet is the initial value of this parameter.
    On MS-Windows, the initial value depends on the executable program manifest.
    This changed from TCL8.6 to 9.0 for tclsh and wish by adding the following part:
    
    <verbatim>
    	<asmv3:windowsSettings
    		xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">
    	    <activeCodePage>UTF-8</activeCodePage>
    </verbatim>
    
    In consequence, the initial value of "encoding system" changed from cpxxxx (cp1252 on West European language version) to utf-8, but is dependent on the way, it is build. If tcl is embedded, the system encoding may depend on the manifest of the parent application outside of the control of TCL itself.
    It also applies to TCL 8.6.
    
    Other platforms may have different details.
    
    In consequence, the description of the command may be changed to reflect this functionality.
    
    A proposal for the rewording is started with commit [ade0479e60] within branch [doc-encoding-system].
    Remark, that the information for TCL 9 and TCL 8 should be different.
    The change within the version may already be announced in 8.6 and underlined in 9.0.
    Concrete platform information is pending.
    
    It should also be stated, if this information is thread local or process local, e.g. if changed, where is it applied.
    
    In addition, a compatibility recipe to 8.6 may be added here, if one wants to restore the "no manifest" value by the script level.
    
    Many questions, sorry !
    Thank you for all,
    Harald
    
  5. foundin changed to: "8.6 - 9.0"
  6. is_private changed to: "0"
  7. login: "oehhar"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "oehhar"
  14. subsystem changed to: "16. Commands A-H"
  15. title changed to:
    Documentation of "encoding system" may be enhanced.
    
  16. type changed to: "RFE"