encoding dirs
Gives or sets the folders of the encoding files.
encoding dirs ?DIRLIST?
Description
With no argument, gives the list of folders where ztcl looks for an encoding file, NAME.enc. With DIRLIST, sets that list and gives an empty string.
Before a script sets the list, it is the folder encoding of $tcl_library when that variable exists, and empty when it does not. The runner sets no tcl_library, so the list starts empty. A file is read through the file layer of the interpreter, so a path must be inside the root folder of the embedder.
The file has the format of the encoding files of Tcl: a type line of S, D, M, or E, then the tables of the code pages in hexadecimal.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| DIRLIST | list | none | The new list of folders. |
Returns
The list of folders, or an empty string after a set.
Examples
% encoding dirs
% set tcl_library /opt/tcl; encoding dirs
/opt/tcl/encoding
% encoding dirs {/usr/share/tcl/encoding}; encoding dirs
/usr/share/tcl/encoding
Errors
% encoding dirs "a {b"
expected directory list but got "a {b"
-errorcode NONE
% encoding dirs a b
wrong # args: should be "encoding dirs ?dirList?"
-errorcode TCL WRONGARGS
Facts
- Capability
channels. A new interpreter does not have it until the host turns it on.- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1