|
2024-07-01
| ||
| 12:25 | • New ticket [a008bc0a7e] Documentation of "encoding system" may be enha... artifact: 9fb3bbfb33 user: oehhar | |
| 09:10 | Ticket [a008bc0a7e]: Documentation of encoding system rewording proposal leaf check-in: ade0479e60 user: oehhar tags: doc-encoding-system | |
Documentation of "encoding system" may be enhanced.
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.
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:
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings"> <activeCodePage>UTF-8</activeCodePage>
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
ade0479e60Ticket [a008bc0a7e]: Documentation of encoding system rewording proposal check-in2024-07-01 09:10:46