Unicode and Internationalization

The effect of Unicode on Tcl scripts is actually very limited. There is a new backslash sequence, \uXXXX, that specifies a 16-bit Unicode character. There are also facilities to work with character set encodings and message catalogs.

fconfigure -encoding

The Tcl I/O system supports character set translations. It automatically converts files to Unicode when it reads them in, and it converts them to the native system encoding during output. The fconfigure -encoding option can be used to specify alternate encodings for files. This option is described on page 209.

The encoding Command

The encoding command provides access to the basic encoding mechanism used in Tcl. The encoding convertfrom and convertto operations ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.