This version is out of date, covering development from v9.5.0 to v9.7.3. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v9 Icon

Counting characters in strings

String.size and $TextLength (i.e. $Text.size) report the length of the UTF-16 representation of the text of the notes. Unicode can represent more than a million distinct characters. Most such characters count as a single character, i.e. count of +1 in String.size and $TextLength. These characters in the 'base multilingual plane 'which include most modern languages and many common symbols. They include 'invisible' characters such as spaces, line returns and tabs. This also includes:

However, some other literal characters need more data to describe them, so-called 'double-byte' characters. Each of these counts as two characters for the purposes of String.size and $TextLength. Examples are: