.
D 2024-06-16T11:42:43.787
L Unsupported\sicu\scommand
N text/x-markdown
U apnadkarni
W 1059
This is a proposal to add a `tcl::unsupported::icu` command to Tcl 9.
The primary goal is to help with migration of Tcl 8 scripts to Tcl 9.
A (much) lesser benefit is to be able to experiment with ICU functions
for handling strings and encodings.
## Motivation
There are two changes in Tcl 9 that together can prevent even sourcing
Tcl 8 scripts.
- Change in the `source` encoding command to use UTF-8 by default.
- The introduction of the `strict` encoding profile for (most) I/O.
The two changes above mean that even a single copyright (U+00A9) character
in an otherwise ASCII file will prevent the script from being loaded if
the file is in ISO8859-1 encoding as is common.
In addition, text files containing non-ASCII characters that were written
in `[encoding system]` in Tcl 8 may not be readable in Tcl 9 without an
explicit `fconfigure -encoding` invocation. This is a particular problem
on Windows as `[encoding system]` in Tcl 9 returns `utf-8` irrespective
of the user's code page setting that was used in Tcl 8.
The
Z 8ef39733a4435e08c7d253b0ea2ebf3a