Previous section   Next section

Practical Programming in Tcl & Tk, Third Edition
By Brent B. Welch

Table of Contents
Chapter 53.  Tcl/Tk 8.2

Faster String Operations

The UTF-8 encoding has the drawback that characters are not all the same size: they are either one, two, or three bytes in length. This makes operations like string length, string index, and string range quite slow in comparison to a system that uses fixed-sized characters. A new Unicode string type, which uses 16-bit characters, was added to support faster string operations. This does not cause any changes that are visible to Tcl scripts, except for improved performance in comparison to Tcl 8.1.

      Previous section   Next section