Skip to content
Tcl Source Code Changes To Migrating scripts to Tcl 9
Login

Changes To Migrating scripts to Tcl 9

Changes to "Migrating scripts to Tcl 9" between 2023-12-20 13:33:06 and 2023-12-20 13:36:50

︙
153
154
155
156
157
158
159















160
161
162
163
164
165
166
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







In addition, library names compiled with TCL9 headers get the prefix "tcl9" in its name.
The aim is to have a version for TCL8.7 and TCL9 in the same folder.

The names are as follows:

   *   tk87.dll -> tcl9tk87.dll (on Windows)
   *   libtk8.7.so -> libtcl9tk8.7.so (on UNIX)

A typical multi-version pckIndex.tcl file may look like this:

```
if {![package vsatisfies [package provide Tcl] 8.6-]} {
    return
}
if {[package vsatisfies [package provide Tcl] 9.0-]} {
    package ifneeded tdbc::odbc 1.1.6 \
	    "[list load [file join $dir tcl9tdbcodbc116.dll] [string totitle tdbcodbc]]"
} else {
    package ifneeded tdbc::odbc 1.1.6 \
	    "[list load [file join $dir tdbcodbc116.dll] [string totitle tdbcodbc]]"
}
```

See [TIP 595](https://core.tcl-lang.org/tips/doc/trunk/tip/595.md).

## Default encoding for scripts is UTF-8

The default encoding used when reading scripts, either with the `source`
command without an explicit `-encoding` option, or passed as a command
︙